fix: allow matching dynamic page routes

This commit is contained in:
Daniel Roe 2021-02-16 11:29:18 +00:00
parent c1cd37d8c5
commit 0942d72553

View File

@ -73,7 +73,7 @@ export function dynamicRequire ({ dir, globbyOptions, inline }: Options): Plugin
return {
map: null,
code: code.replace(
/Promise.resolve\(\).then\(function \(\) \{ return require\('([^']*)' \/\* webpackChunk \*\/\); \}\).then\(function \(n\) \{ return n.([a-zA-Z]*); \}\)/g,
/Promise.resolve\(\).then\(function \(\) \{ return require\('([^']*)' \/\* webpackChunk \*\/\); \}\).then\(function \(n\) \{ return n.([_a-zA-Z0-9]*); \}\)/g,
"require('$1').$2")
}
}