fix: allow numbers in dynamic webpack chunk names (#125)

This commit is contained in:
Daniel Roe 2021-02-16 12:11:52 +00:00 committed by GitHub
parent 0942d72553
commit 27aef1489f

View File

@ -57,7 +57,7 @@ export function dynamicRequire ({ dir, globbyOptions, inline }: Options): Plugin
const chunks = files.map(id => ({
id,
src: resolve(dir, id).replace(/\\/g, '/'),
name: '_' + id.replace(/[^a-zA-Z_]/g, '_'),
name: '_' + id.replace(/[^a-zA-Z0-9_]/g, '_'),
meta: getWebpackChunkMeta(resolve(dir, id))
}))