Open neil-benn opened 4 years ago
/**
* Custom angular webpack configuration
*/
const JavaScriptObfuscator = require('webpack-obfuscator');
module.exports = (config, options) => {
if (config.mode === 'production') {
config.plugins.push(new JavaScriptObfuscator({
// rotateUnicodeArray: true,
unicodeEscapeSequence: false,
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.75,
// deadCodeInjection: true,
// deadCodeInjectionThreshold: 0.4,
debugProtection: false,
debugProtectionInterval: false,
disableConsoleOutput: true,
identifierNamesGenerator: 'hexadecimal',
log: false,
seed: 1,
renameGlobals: false,
rotateStringArray: true,
selfDefending: true,
stringArray: true,
stringArrayEncoding: 'rc4',
stringArrayThreshold: 0.75
}, []));
}
return config;
}
Hello,
I'm very sorry to ask such a basic question but I need guidance. I've got currently in my angular.json for the build:
This is fairly standard; we've not changed much. So firstly I install the custom webpack dependency:
npm i @angular-builders/custom-webpack -D
Then I have to configure the custom-webpack to include the obfuscation so I modify the above to the following:
I then reference the obfuscation file custom-webpack.config.js which is as follows:
I'm on Angular 8.3.25 but this is giving me 'An unhandled exception occurred: Job name "..getProjectMetadata" does not exist.'.
Again; I'm sorry if this is not specific to this tool but I'm unsure how to get from the angular.json I have now to the obfuscation detailed in the guide?
I'm happy to write this up in a detailed tutorial when done!