codymikol / karma-webpack

Karma webpack Middleware
MIT License
830 stars 222 forks source link

fix: add dynamic imports to main bundle #384

Closed daKmoR closed 5 years ago

daKmoR commented 5 years ago

In order to support dynamic imports we add all their contents to the main bundle as well.

This PR contains a:

Motivation / Use-Case

If you use import('./foo.js').then() webpack will by default create different chunks. As they are not auto served by karma we add the dynamic content to the main bundle as well.

matthieu-foucault commented 5 years ago

For future reference, can you use the Angular format (and/or use commitizen) for your commits? This allows automated generation of changelogs.

You're just missing the scope (which would be karma-webpack, although we could be more precise if need be)

daKmoR commented 5 years ago

oh I'm more used to have scopes for mono repos... e.g. each package having it's own scope.

As karma-webpack is a single package - which scopes would we use? is there a list?

matthieu-foucault commented 5 years ago

There is no list as far as I'm aware. Looking at the commit history, those have been used pretty inconsistently as far as I can tell.

Maybe using the name of the file most affected by the change, or the class/object name. For instance, if we want to easily track changes to the default webpack options, then defaultWebpackOptions could be a scope. I don't have strong opinions on this, it's mostly a matter of formatting the changelog (and looking at it, it does seem that it works without a scope)