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