Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 175279f

Browse files
committed
Merge pull request #16 from diurnalist/feature/asset-path-plugin
Use Compilation.getPath instead of replacing regexes manually
2 parents cbc8b3f + 18c8d2e commit 175279f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,9 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
143143
var assetContents = {};
144144
contents.forEach(function(item) {
145145
var chunk = item.chunk;
146-
var file = filename
147-
.replace(Template.REGEXP_NAME, chunk.name || chunk.id)
148-
.replace(Template.REGEXP_HASH, compilation.hash)
149-
.replace(Template.REGEXP_CHUNKHASH, chunk.renderedHash);
146+
var file = compilation.getPath(filename, {
147+
chunk: chunk
148+
});
150149
assetContents[file] = (assetContents[file] || []).concat(item.content);
151150
chunk.files.push(file);
152151
});

0 commit comments

Comments
 (0)