jspm / jspm-cli

ES Module Package Manager
https://jspm.org
Apache License 2.0
3.77k stars 273 forks source link

jspm bundle isn't bundling listed dependencies of a module. #1814

Closed MeirionHughes closed 8 years ago

MeirionHughes commented 8 years ago

I have installed aurelia-bootstrapper with jspm 0.16.31. In .dependencies.json it has listed dependencies:

"npm:aurelia-bootstrapper@1.0.0-beta.1.2.1": {
    "aurelia-event-aggregator": "npm:aurelia-event-aggregator@^1.0.0-beta.1.1.0",
    "aurelia-framework": "npm:aurelia-framework@^1.0.0-beta.1.1.0",
    "aurelia-history": "npm:aurelia-history@^1.0.0-beta.1.1.1",
    "aurelia-history-browser": "npm:aurelia-history-browser@^1.0.0-beta.1.1.1",
    "aurelia-loader-default": "npm:aurelia-loader-default@^1.0.0-beta.1.1.1",
    "aurelia-logging-console": "npm:aurelia-logging-console@^1.0.0-beta.1.1.3",
    "aurelia-pal": "npm:aurelia-pal@^1.0.0-beta.1.1.1",
    "aurelia-pal-browser": "npm:aurelia-pal-browser@^1.0.0-beta.1.1.2",
    "aurelia-polyfills": "npm:aurelia-polyfills@^1.0.0-beta.1.0.0",
    "aurelia-router": "npm:aurelia-router@^1.0.0-beta.1.1.0",
    "aurelia-templating": "npm:aurelia-templating@^1.0.0-beta.1.1.0",
    "aurelia-templating-binding": "npm:aurelia-templating-binding@^1.0.0-beta.1.1.0",
    "aurelia-templating-resources": "npm:aurelia-templating-resources@^1.0.0-beta.1.1.0",
    "aurelia-templating-router": "npm:aurelia-templating-router@^1.0.0-beta.1.1.0"
  },

if I try to bundle it: jspm bundle aurelia-bootstrapper it doesn't bundle all the dependencies:

D:\Code\Applications\Example>jspm bundle aurelia-bootstrapper
     Building the bundle tree for aurelia-bootstrapper...

       npm:aurelia-bootstrapper@1.0.0-beta.1.2.1.js
       npm:aurelia-bootstrapper@1.0.0-beta.1.2.1/aurelia-bootstrapper.js
       npm:aurelia-pal-browser@1.0.0-beta.1.2.1.js
       npm:aurelia-pal-browser@1.0.0-beta.1.2.1/aurelia-pal-browser.js
       npm:aurelia-pal@1.0.0-beta.1.2.2.js
       npm:aurelia-pal@1.0.0-beta.1.2.2/aurelia-pal.js
       npm:aurelia-polyfills@1.0.0-beta.1.1.4.js
       npm:aurelia-polyfills@1.0.0-beta.1.1.4/aurelia-polyfills.js

ok   Built into build.js with source maps, unminified.

Is this a bug? or is there an option I'm missing? I would like to bundle everything...

guybedford commented 8 years ago

Aurelia does dynamic System.import calls which aren't traceable when doing bundling. I believe the Aurelia bundler should tackle that though. Tracing dynamic System.import calls is something we aim to support in future via https://github.com/systemjs/builder/issues/452.

MeirionHughes commented 8 years ago

Aurelia's bundler has the same behavior; it doesn't bundle unless the import is detected. To be honest I'm surprised there isn't an option in either to bundle known dependencies; they are, after all, already defined and known by jspm. I guess I could parse .dependencies.json, remove duplicates and make a large bundle manually.

supporter-bot commented 8 years ago

If the support you've received on this issue has helped your project, perhaps consider leaving a tip for the maintainer.

Donate to the project via SupporterHQ.