Skip to content

Commit

Permalink
fix: ensure webpack paths include a trailing slash (#285)
Browse files Browse the repository at this point in the history
Prior to #297, the following paths would always end with a slash:
- `webpackOptions.output.publicPath`
- `webpackOptions.output.publicPath`
- `webpackMiddlewareOptions.publicPath`

Fixes #284
  • Loading branch information
darsee authored and joshwiens committed Dec 14, 2017
1 parent c781f4e commit be2b0e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/karma-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ function Plugin(

// Must have the common _karma_webpack_ prefix on path here to avoid
// 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.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
Expand Down Expand Up @@ -133,7 +133,7 @@ function Plugin(
}
}.bind(this))

webpackMiddlewareOptions.publicPath = path.join(os.tmpdir(), '_karma_webpack_')
webpackMiddlewareOptions.publicPath = path.join(os.tmpdir(), '_karma_webpack_', '/')
var middleware = this.middleware = new webpackDevMiddleware(compiler, webpackMiddlewareOptions)

customFileHandlers.push({
Expand Down

0 comments on commit be2b0e8

Please sign in to comment.