Skip to content

Commit

Permalink
fix(karma-webpack): allow filename and chunkFilename to be overri…
Browse files Browse the repository at this point in the history
…dden (`config.output`) (#336)
  • Loading branch information
Teamop authored and michael-ciniawsky committed Aug 29, 2018
1 parent 1ac16ea commit c256d87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/karma-webpack.js
Expand Up @@ -62,11 +62,15 @@ function Plugin(
// https://github.com/webpack/webpack/issues/645
webpackOptions.output.path = path.join(os.tmpdir(), '_karma_webpack_', indexPath, '/')
webpackOptions.output.publicPath = path.join(os.tmpdir(), '_karma_webpack_', publicPath, '/')
webpackOptions.output.filename = '[name]'
if (includeIndex) {
webpackOptions.output.jsonpFunction = `webpackJsonp${index}`
}
webpackOptions.output.chunkFilename = '[id].bundle.js'
if (!webpackOptions.output.filename) {
webpackOptions.output.filename = '[name].js'
}
if (!webpackOptions.output.chunkFilename) {
webpackOptions.output.chunkFilename = '[id].bundle.js'
}
})

this.emitter = emitter
Expand Down

0 comments on commit c256d87

Please sign in to comment.