From dce9ac2593aba9f8b411cd6b54a1a8fae1baff90 Mon Sep 17 00:00:00 2001 From: David Blurton Date: Wed, 10 Aug 2016 00:59:38 +0000 Subject: [PATCH] Use path.join instead of string concatenation --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 8ee3595..0823cbf 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,5 @@ +import path from 'path' + class AppCache { constructor(cache, network, fallback, settings, hash, comment) { @@ -73,7 +75,7 @@ export default class AppCachePlugin { const appCache = new AppCache(this.cache, this.network, this.fallback, this.settings, compilation.hash, this.comment); Object.keys(compilation.assets) .filter(asset => !this.exclude.some(pattern => pattern.test(asset))) - .forEach(asset => appCache.addAsset(publicPath + asset)); + .forEach(asset => appCache.addAsset(path.join(publicPath, asset))); compilation.assets[this.output] = appCache; callback(); });