ember-cli-node-modules-to-vendor
Easily import packages (non ember addons) from node_modules
(you can import from any folder if you want to)
Installation
ember install ember-cli-node-modules-to-vendor
Usage
// ember-cli-build.js // ... var app = defaults nodeModulesToVendor: 'node_modules/some-package/dist/js' ; // then you can easily doapp; // ...
Advanced Usage
You can supply a tree if you want finer control:
// ember-cli-build.js var Funnel = ;var UnwatchedDir = UnwatchedDir;// ... var app = defaults nodeModulesToVendor: /* UnwatchedDir is optional, but it is rare to need a watcher assigned to a node_modules dependencies */ 'node_modules/some-package/dist/js' destDir: 'some-package' files: 'only-this-file.js' ; app;
Note: omitting the destDir
option will place the file directly into the vendor
folder, so app.import('vendor/only-this-file.js')
would be your import instead.
You can conditionally import:
// ember-cli-build.js // ... { return EmberAppenv !== 'production';} // ... var nodeModulesToVendor = ;if nodeModulesToVendor; var app = defaults nodeModulesToVendor: nodeModulesToVendor; if app; // ...