Skip to content

Commit fe39d52

Browse files
authored
Merge pull request #42 from njbmartin/patch-1
Fix issue with filename functions
2 parents 9c3a286 + 9435b5a commit fe39d52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/build-file.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ module.exports = ({ compiler, gitWorkTree, command, replacePattern, asset }) =>
1313
})
1414
})
1515

16-
compilation.mainTemplate.hooks.assetPath.tap('asset-path', (path) => {
17-
return path.replace(replacePattern, data)
16+
compilation.mainTemplate.hooks.assetPath.tap('asset-path', (assetPath, chunkData) => {
17+
return (typeof assetPath === 'function'
18+
? assetPath(chunkData)
19+
: assetPath).replace(replacePattern, data)
1820
})
1921
})
2022

0 commit comments

Comments
 (0)