From 7334dbc1401b7049afb89509cd27fe8ff28e2bf8 Mon Sep 17 00:00:00 2001 From: Michal Kawalec Date: Fri, 11 Mar 2016 10:09:09 -0800 Subject: [PATCH] feat(webpack): support chunks without errors --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f8dc4e13..6d9abbe3 100644 --- a/index.js +++ b/index.js @@ -29,15 +29,16 @@ function Plugin( // When using an array, even of length 1, we want to include the index value for the build. // This is due to the way that the dev server exposes commonPath for build output. var indexPath = includeIndex ? index + "/" : ""; + var publicPath = indexPath !== "" ? indexPath + '/' : ""; // Must have the common _karma_webpack_ prefix on path here to avoid // https://github.com/webpack/webpack/issues/645 webpackOptions.output.path = "/_karma_webpack_/" + indexPath; - webpackOptions.output.publicPath = "/_karma_webpack_/" + indexPath + "/"; + webpackOptions.output.publicPath = "/_karma_webpack_/" + publicPath; webpackOptions.output.filename = "[name]"; if(includeIndex) webpackOptions.output.jsonpFunction = "webpackJsonp" + index; - webpackOptions.output.chunkFilename = "[id].chunk.js"; + webpackOptions.output.chunkFilename = "[id].bundle.js"; }); this.emitter = emitter;