Skip to content

Commit

Permalink
perf(bytecodePlugin): warn that strings cannot be protected when mini…
Browse files Browse the repository at this point in the history
…fication is enabled (#417)
  • Loading branch information
alex8088 committed Mar 3, 2024
1 parent ad891af commit 0ce505a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/bytecode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ce505a

Please sign in to comment.