jeffbcross / aim

82 stars 27 forks source link

@reactivex bundled 2 times #25

Closed pkozlowski-opensource closed 8 years ago

pkozlowski-opensource commented 8 years ago

@reactivex is included 2 times in the WebPack: once from the "root" npm dependency and second time from ng2 transitive dependencies. Not big deal for demos but I guess people might be using this (and other) projects as starter kits, so would be good to fix.

Unfortunately my WebPack-foo is pretty weak so I'm not sure how to fix it atm.

Oh, and BTW: is there is any particular reason for explicitly declaring all the ng2 transitive dependencies? (zone, reflect-metadata, @reactivex)? This might be actually a reason for those things being bundled twice.

jeffbcross commented 8 years ago

@pkozlowski-opensource thanks! We need zone and reflect-metadata because we're using the CJS output from Angular now, and need to explicitly require those in our main app file. I'm not sure if there's a way to configure npm to de-dupe those from within our project?

We could change our build to use the bundle instead, but I'm scared to do that at this point.

We're also using Observable stuff directly from rxjs in several places.

pkozlowski-opensource commented 8 years ago

@jeffbcross I'm far from suggesting changing things at the last minute! :-) And bundles wouldn't work atm as we don't have CJS bundles :-(

I've just left the comment so we can look into this / similar build-related issues post-AC.

We need zone and reflect-metadata because we're using the CJS output from Angular now, and need to explicitly require those in our main app file

Interesting. I've noticed that Tobias and Victor are using different approach for Zone / reflect-metadata, by simply including those in the <script> tag and not requiring them from the app code: https://github.com/vsavkin/tex/blob/af40b5aca489c05e8c96b95152b19ab7671c086a/angular2/index.html#L38-L43

Would be good to discuss / unify those different setups so people are not confused.