Closed louistb closed 3 years ago
Hi. Use loader instead of plugin https://github.com/javascript-obfuscator/webpack-obfuscator#loader-usage
Ok got it to work, thanks for the heads up :)
@sanex3339 I want todo the same for nextjs but it keeps obfuscation everything and does not seem to listen to the exclude option
webpack: (config, options) => {
if (!options.dev && !options.isServer) {
config.module.rules.push({
test: /\\.+(ts|tsx)$/,
exclude: /node_modules/,
enforce: 'post',
use: {
loader: WebpackObfuscator.loader,
options: {
compact: true,
identifierNamesGenerator: 'mangled',
selfDefending: true,
stringArray: true,
rotateStringArray: true,
shuffleStringArray: true,
stringArrayEncoding: [],
stringArrayThreshold: 0.8,
splitStrings: true,
splitStringsChunkLength: 6,
transformObjectKeys: true,
}
}
})
}
Do you have any pointers?
@sarendsen did you ever figure this out?
Would it be possible to exclude or include files within the bundle ? Maybe its possible and i dont understand the plugin fully.
Im packing a electron app and i dont want the node_modules obfuscated but i want the app code to be.
Right now it seems like its only possible to include/exclude bundles.
Thanks :)