fix(webpack): respect build.transpile (#5043)

This commit is contained in:
Daniel Roe 2022-06-10 14:18:31 +01:00 committed by GitHub
parent 970758e050
commit 5d4586a322
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,8 @@ export function base (ctx: WebpackConfigContext) {
baseAlias,
baseConfig,
basePlugins,
baseResolve
baseResolve,
baseTranspile
])
}
@ -157,9 +158,7 @@ export function baseTranspile (ctx: WebpackConfigContext) {
pattern = pattern(ctx)
}
if (typeof pattern === 'string') {
const posixModule = pattern.replace(/\\/g, '/')
// TODO: should only do for clientside? (hint: pathNormalize)
transpile.push(new RegExp(escapeRegExp(normalize(posixModule))))
transpile.push(new RegExp(escapeRegExp(normalize(pattern))))
} else if (pattern instanceof RegExp) {
transpile.push(pattern)
}