From be2b0e83f9448617ea56f62321dbaf087c0b384a Mon Sep 17 00:00:00 2001 From: Seamus D'Arcy Date: Thu, 14 Dec 2017 19:46:42 +0000 Subject: [PATCH] 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 --- src/karma-webpack.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/karma-webpack.js b/src/karma-webpack.js index c3b6c3c..0fa5e4f 100644 --- a/src/karma-webpack.js +++ b/src/karma-webpack.js @@ -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 @@ -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({