Skip to content

Commit

Permalink
fix: interpolate publicPath properly
Browse files Browse the repository at this point in the history
  • Loading branch information
kisenka committed Sep 19, 2018
1 parent 08e0af1 commit 22f10e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,11 @@ class SVGSpritePlugin {
const chunk = new Chunk(chunkName);
chunk.ids = [];
chunk.files.push(filename);
const filenamePrefix = this.rules.publicPath
? this.rules.publicPath.replace(/^\//, '')
: '';

compilation.assets[`${this.rules.publicPath || ''}${filename}`] = {
compilation.assets[`${filenamePrefix}${filename}`] = {
source() { return content; },
size() { return content.length; }
};
Expand Down

0 comments on commit 22f10e6

Please sign in to comment.