Skip to content

Commit

Permalink
fix(karma-webpack): disable optimization by default (`webpack >= v4…
Browse files Browse the repository at this point in the history
….0.0`) (#325)
  • Loading branch information
scottohara authored and michael-ciniawsky committed Sep 1, 2018
1 parent 3581cf9 commit 51bdcaa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/karma-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,21 @@ function Plugin(
if (includeIndex) {
webpackOptions.output.jsonpFunction = `webpackJsonp${index}`
}

if (!webpackOptions.output.filename) {
webpackOptions.output.filename = '[name].js'
}

if (!webpackOptions.output.chunkFilename) {
webpackOptions.output.chunkFilename = '[id].bundle.js'
}

// For webpack 4+, optimization.splitChunks and optimization.runtimeChunk must be false.
// Otherwise it hangs at 'Compiled successfully'
if (webpackOptions.optimization) {
webpackOptions.optimization.splitChunks = false
webpackOptions.optimization.runtimeChunk = false
}
})

this.emitter = emitter
Expand Down

0 comments on commit 51bdcaa

Please sign in to comment.