fix: use allowlist approach to chunk name (#101)

closes #93
This commit is contained in:
Daniel Roe 2021-02-05 17:52:18 +00:00 committed by GitHub
parent 31a9bc2d18
commit c76bd35c29

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(/[\\/.]/g, '_'),
name: '_' + id.replace(/[^a-zA-Z_]/g, '_'),
meta: getWebpackChunkMeta(resolve(dir, id))
}))