I developed an ember-cli addon that works fine. My addon is a project by itself with a dummy site to test it, a couple of unit tests etc.
When I run the command ember build --production
, it basically creates a vendor.js file that contains my addon and all dependencies (bower_components such ember, jquery etc…) which is about 2MB.
I’d like to know if it’s possible to export the addon on its own (vendor.js) without any dependencies inside, just as a vendor I can use? My main project that is using this addon already have ember, jquery… so I don’t want that to be duplicated.
I’m basically trying to make my ember-cli addon a component that I can include in multiple ember projects. My addon and all dev dependencies are more than 100MB of data (including node modules, express, broccoli, tests…), so when I run the command npm install my-addon
in my main project, it installs everything (including dev dependencies, tests etc…) which is pretty big. I don’t really need that in my other project, the addon itself (dist version) should be only couple of KB and that’s all I need…
My addon looks like this:
/my-addon
/addon
/app
/bower_components
/node_modules
/tests
package.json
Brocfile.js etc..
package.json:
{
"name": "my-addon",
"version": "0.0.1",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"start": "ember server",
"build": "ember build",
"test": "ember test"
},
"engines": {
"node": ">= 0.10.0"
},
"devDependencies": {
"body-parser": "^1.2.0",
"broccoli-sass": "0.3.2",
"broccoli-asset-rev": "0.3.1",
"broccoli-ember-hbs-template-compiler": "^1.6.1",
"ember-cli": "0.1.2",
"ember-cli-content-security-policy": "0.3.0",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-qunit": "0.1.0",
"ember-data": "1.0.0-beta.10",
"ember-export-application-global": "^1.0.0",
"express": "^4.8.5",
"glob": "^4.0.5"
}
"keywords": [
"ember-addon"
],
"ember-addon": {
"configPath": "tests/dummy/config"
}
}
Thanks