jspm / jspm-cli

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

[0.17-beta.21] Bundling doesn't pick up new modules #1914

Closed jackfranklin closed 8 years ago

jackfranklin commented 8 years ago

If you're running jspm bundle foo -wid and install a new package you have to restart the bundle for it to pick up the package. It would be great if this could be avoided, although I realise this could be a little bit tricky.

guybedford commented 8 years ago

Thanks, this can actually be implemented relatively simply by just ensuring the configuration file is being watched. This is item 2 in https://github.com/jspm/jspm-cli/issues/1789.

jackfranklin commented 8 years ago

@guybedford sounds like it might be one I could take a stab at...

guybedford commented 8 years ago

Sure, that would be welcome! It's the path at config.package.configFile to add to the watch list, including checking if configFileBrowser etc also exist. On Tue, 14 Jun 2016 at 18:28, Jack Franklin notifications@github.com wrote:

@guybedford https://github.com/guybedford sounds like it might be one I could take a stab at...

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/jspm/jspm-cli/issues/1914#issuecomment-225937651, or mute the thread https://github.com/notifications/unsubscribe/AAkiypmf0wHVZvjQFne_J6lDfesvgbukks5qLtaLgaJpZM4I1cGU .

jackfranklin commented 8 years ago

@guybedford I started doing this but then the issue is that I think jspm bundle touches jspm.config.js everytime, and hence it just infinitely rebuilds constantly. I'm thinking I need to do a check in the code when the file changed is a config file, and actually require it and see if any of the bits we care about have changed (aka, anything other than the browserConfig.bundles mapping) ?

jackfranklin commented 8 years ago

Except we can't require the config and check what changed because they aren't JSON / exporting a config. How can I get around this?

guybedford commented 8 years ago

Ahh ok. I'd stick with the original method but perhaps a flag can be used to ignore configuration change file events during the reinjection process itself? On Wed, 15 Jun 2016 at 10:13, Jack Franklin notifications@github.com wrote:

Except we can't require the config and check what changed because they aren't JSON / exporting a config. How can I get around this?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/jspm/jspm-cli/issues/1914#issuecomment-226118361, or mute the thread https://github.com/notifications/unsubscribe/AAkiypNWLNdgRrA0cmMxsD2KQonE73djks5qL7PvgaJpZM4I1cGU .

jackfranklin commented 8 years ago

@guybedford I opened #1916 which has my attempts so far.