mirror of
https://github.com/alex8088/electron-vite.git
synced 2025-04-06 04:05:44 +08:00
perf(bytecodePlugin): warn that strings cannot be protected when minification is enabled (#417)
This commit is contained in:
parent
ad891af811
commit
0ce505a12f
@ -198,9 +198,12 @@ export function bytecodePlugin(options: BytecodeOptions = {}): Plugin | null {
|
||||
if (useInRenderer) {
|
||||
config.logger.warn(colors.yellow('bytecodePlugin does not support renderer.'))
|
||||
}
|
||||
if (resolvedConfig.build.minify && protectedStrings.length > 0) {
|
||||
config.logger.warn(colors.yellow('Strings cannot be protected when minification is enabled.'))
|
||||
}
|
||||
},
|
||||
transform(code, id): void | { code: string; map: SourceMapInput } {
|
||||
if (protectedStrings.length === 0 || !filter(id)) return
|
||||
if (config.build.minify || protectedStrings.length === 0 || !filter(id)) return
|
||||
|
||||
let match: RegExpExecArray | null
|
||||
let s: MagicString | undefined
|
||||
|
Loading…
x
Reference in New Issue
Block a user