From 927164136bd69772d23adec6096e4fb70458a568 Mon Sep 17 00:00:00 2001 From: darrylsepeda Date: Thu, 15 Jun 2017 18:42:48 +0700 Subject: [PATCH] remove webpack public path for index.html #79 --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 0a597a0..1dc178f 100644 --- a/src/index.js +++ b/src/index.js @@ -102,7 +102,9 @@ class SWPrecacheWebpackPlugin { // get all assets outputted by webpack const assetGlobs = Object .keys(compilation.assets) - .map(f => path.join(outputPath, f)); + .map(f => { + return (f === 'index.html') ? path.join('/', f) : path.join(outputPath, f); + }); // merge assetGlobs with provided staticFileGlobs and filter using staticFileGlobsIgnorePatterns const staticFileGlobs = assetGlobs.concat(this.options.staticFileGlobs || []).filter(text =>