codymikol / karma-webpack

Karma webpack Middleware
MIT License
830 stars 222 forks source link

fix(karma-webpack): Override `output.filename` with '[name].js' #381

Closed matthieu-foucault closed 5 years ago

matthieu-foucault commented 5 years ago

This PR contains a:

Motivation / Use-Case

If there are multiple tests, and the webpack configuration has a static output.filename, e.g. 'bundle.js', all entry points will be emitted to the same bundle. Karma will output errors, and karma-webpack will ultimately fail as test files will not have any corresponding output file.

matthieu-foucault commented 5 years ago

@thijstriemstra: this pull request should fix your issue

thijstriemstra commented 5 years ago

thanks for the ping @matthieu-foucault, can i install and test this PR using npm?

matthieu-foucault commented 5 years ago

thanks for the ping @matthieu-foucault, can I install and test this PR using npm?

Yes, using npm install webpack-contrib/karma-webpack#fix-static-output.filename

thijstriemstra commented 5 years ago

works: "karma-webpack@4.0.0-beta.0" doesn't work: "karma-webpack@4.0.0-rc.5" this PR: works!

thanks @matthieu-foucault

thijstriemstra commented 5 years ago

@matthieu-foucault can this be released as a new RC?

matthieu-foucault commented 5 years ago

@thijstriemstra Done! Sorry for the delay

thijstriemstra commented 5 years ago

thanks. for some reason it doesn't allow me to install rc.6

No matching version found for karma-webpack@4.0.0-rc.6

And dev installs rc.5...

matthieu-foucault commented 5 years ago

It does appear in npmjs though (under the next tag): https://www.npmjs.com/package/karma-webpack/v/4.0.0-rc.6

dev should install v5 alpha