aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

Transient data stored in git-tracked config.js #137

Closed pasky closed 8 years ago

pasky commented 8 years ago

The bundler stores depCache and more within config.js, which is recommended to be tracked in git AFAIK. However, after each gulp bundle, config.js is rewritten with different ordering and therefore each commit contains massive churn in the config.js file, merges always generate conflicts that are impossible to resolve etc.

Maybe this issue is more with the skeleton task and it's possible to achieve a setup where this data is stored outside of config.js, but I couldn't find any example of that.

Maybe I'm missing something obvious as right now I just don't understand how can people use bundling and track their projects in git at the same time. But I couldn't get any feedback on this on gitter...

atsu85 commented 8 years ago

One thing I'm doing to avoid massive git diffs, is always running bundling task after jspm cli commands(such as jspm install jquery), that change config.js. That way the file is always formatted with the same tool (and same formatting rules) before i commit. I hope it helps you as a workaround, but ideally bundler should format exactly the same way as jspm cli.

pasky commented 8 years ago

Thanks for the advice - but I think I'm still missing something, as I need to re-bundle the app itself after each change, I don't bundle just the dependencies.

(Though, giving up on bundling the app itself might be an okay temporary compromise.)

atsu85 commented 8 years ago

Oh i forgot to mention that i created separate bundles for app and another for third party assets. At dev time i only bundle third party assets.

pasky commented 8 years ago

@EisenbergEffect was this bug fixed in newer Aurelia versions, does gulp bundle keep its data outside of config.js now? I gave up on bundling for the time being but I'd be happy to try it again.

EisenbergEffect commented 8 years ago

I think it's out of Aurelia's control unfortunately. It is system.js and system-builder that mess with the configuration file. Perhaps @ahmedshuhel can shed some more light on that.

ahmedshuhel commented 8 years ago

depCache and bundle injection are handled by the aurelia-bundler. The order of the serialization of config object in the config file is different in jspm. Will have to dig into the jspm code base to find the order and then implement the same ourselves in aurelia-bundler. The problem is this something jspm can change anytime and this feature of ours will be broken. @EisenbergEffect any advice on how should we proceed.