How do I obfuscate my next.js app?
I've built it in the nextron framework.
This is my next.config.js:
const WebpackObfuscator = require('webpack-obfuscator');
module.exports = {
webpack: (config, { dev, isServer }) => {
config.target = 'electron-renderer';
if (!dev) {
config.plugins.push(
new WebpackObfuscator({
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.5,
deadCodeInjection: true,
debugProtection: true,
identifierNamesGenerator: 'mangled',
selfDefending: true,
stringArrayEncoding: true,
}),
);
}
return config;
},
};
When I run yarn build, I get:
[Error: UNKNOWN: unknown error, copyfile 'C:UsersxDocumentsx
enderer.nextstaticchunkswebpack-95c2b224bccf352ee870.js' -> 'C:UsersxDocumentsxapp\_nextstaticchunkswebpack-95c2b224bccf352ee870.js'] {
errno: -4094,
code: 'UNKNOWN',
syscall: 'copyfile',
path: 'C:\Users\x\Documents\x\renderer\.next\static\chunks\webpack-95c2b224bccf352ee870.js',
dest: 'C:\Users\x\Documents\x\app\_next\static\chunks\webpack-95c2b224bccf352ee870.js'
}
The version of Webpack Obfuscator is ^0.28.2. I don't really know how next works so if anyone can help me with this, that would be great.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…