Closed insidewhy closed 7 years ago
I had to make config.externals
a list of every server-side only package. Not sure why this is necessary... would have though webpack would know exactly which modules the client is using.
It includes every module in package.json
and in my project. I was surprised to see a module that wasn't transitively reachable from any entrypoint end up in my build.
I'm convinced now that the way loader-webpack works is by taking every accessible module, whether from node_modules
or my source directories. Could you explain why this is the case? In every other webpack project I've been using only modules that are actually used are included in the bundles.
This will soon be fixed. Stay tuned.
@niieani any news on this? I added a d.ts file in my project and webpack tries to load it, which fails of course because no loader takes care of this kind of files. Thanks!
@sebastien-roch this will be fixed by https://github.com/aurelia/skeleton-navigation/issues/714. PR is ready, so it's a matter for days before you can use it.
@niieani thanks for the update, looking forward to this merge. For now do you have any workaround to handle those *.d.ts
files? Is there currently a way to exclude them from bundling?
Hmm, you could move them our of the src
directory, that should help.
I thought there would be a better workaround ;-) Will try that for now, thanks!
Is this PR in yet? This is a real pain if we need to manually track the externals.
Can I help at all in testing, coding or reviewing this as we would really benefit from it?
Cheers,
Ed
I can confirm that the 2.0.0 release works perfectly :] thank @niieani !
I know this is speaking of a different repo, but for people using https://github.com/aurelia/bootstrapper-webpack/, the issue will remain until https://github.com/aurelia/bootstrapper-webpack/issues/14 is closed ( i have added a pr for it there ).
Cheers !
In my
package.json
(and thereforenode_modules
) I have dependencies for the front-end and the back-end. When I run webpack using the config from the esnext skeleton I get a lot of errors like this:Something in
aurelia-loader-webpack.js
pulls in every single dependency listed in my package.json and/or node_modules?