Why does ember-source npm package have a lot of dependencies?

It seems just jquery is required, but package.json contains a lot of others.

“dependencies”: { “broccoli-funnel”: “^2.0.1”, “broccoli-merge-trees”: “^2.0.0”, “chalk”: “^2.3.0”, “ember-cli-get-component-path-option”: “^1.0.0”, “ember-cli-is-package-missing”: “^1.0.0”, “ember-cli-normalize-entity-name”: “^1.0.0”, “ember-cli-path-utils”: “^1.0.0”, “ember-cli-string-utils”: “^1.1.0”, “ember-cli-valid-component-name”: “^1.0.0”, “ember-cli-version-checker”: “^2.1.0”, “ember-router-generator”: “^1.2.3”, “inflection”: “^1.12.0”, “jquery”: “^3.3.1”, “resolve”: “^1.6.0” },

I’m not going to use ember-cli and if I do “npm install ember-source --save-dev”, many packages are installed with ember-source and jquery.

  • ember-source@3.1.2 added 63 packages in 4.109s

Using ember-source without using ember-cli is not a supported path (as of Ember 3.0.0).

It is absolutely possible to use Ember without jQuery. There is still some amount of work to do to implement this RFC, but the work arounds mentioned in the RFC are functional.

All of these packages are actually used when ember-source is consumed. Some are used by the blueprints (e.g. to support things like ember generate route posts), others are used for the build system, and others still are used to detect which version of other collaborating packages are in use (so that ember-source can work properly with them).

1 Like

I’m able to build a simple ember 3.0 app just by using webpack and not involving ember-cli stuff.

Is it better to place those packages except jquery into devDependencies and place jquery into optDependencies?

Is it better to place those packages except jquery into devDependencies and place jquery into optDependencies?

This would be hugely inconvenient for the 99.99% of Ember users who are using ember-cli. They aren’t devDependencies. Apps that add ember-source need those packages. And they need specific matching versions of them.

Your custom setup is almost certainly broken for a large number of possible addons. If you want to package your app with webpack, that is actually already supported on the current master version of ember-cli via the packager hook.

2 Likes