Skip to content

Commit be2b0e8

Browse files
darseejoshwiens
authored andcommitted
fix: ensure webpack paths include a trailing slash (#285)
Prior to #297, the following paths would always end with a slash: - `webpackOptions.output.publicPath` - `webpackOptions.output.publicPath` - `webpackMiddlewareOptions.publicPath` Fixes #284
1 parent c781f4e commit be2b0e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/karma-webpack.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ function Plugin(
4848

4949
// Must have the common _karma_webpack_ prefix on path here to avoid
5050
// https://github.com/webpack/webpack/issues/645
51-
webpackOptions.output.path = path.join(os.tmpdir(), '_karma_webpack_', indexPath)
52-
webpackOptions.output.publicPath = path.join(os.tmpdir(), '_karma_webpack_', publicPath)
51+
webpackOptions.output.path = path.join(os.tmpdir(), '_karma_webpack_', indexPath, '/')
52+
webpackOptions.output.publicPath = path.join(os.tmpdir(), '_karma_webpack_', publicPath, '/')
5353
webpackOptions.output.filename = '[name]'
5454
if (includeIndex) {
5555
webpackOptions.output.jsonpFunction = 'webpackJsonp' + index
@@ -133,7 +133,7 @@ function Plugin(
133133
}
134134
}.bind(this))
135135

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

139139
customFileHandlers.push({

0 commit comments

Comments
 (0)