bytenode-webpack-plugin icon indicating copy to clipboard operation
bytenode-webpack-plugin copied to clipboard

How do I use JS Obfuscator with this?

Open SamHoque opened this issue 1 year ago • 0 comments

Added it in the plugins doesn't seem to be obfuscating the JS compiled file.

const { BytenodeWebpackPlugin } = require('@herberttn/bytenode-webpack-plugin')
var WebpackObfuscator = require('webpack-obfuscator')
const rules = require('./webpack.rules')


module.exports = {
  entry: { index: './src/main.ts' },
  output: {
    filename: '[name].js',
    devtoolModuleFilenameTemplate: '[absolute-resource-path]'
  },
  module: {
    rules
  },
  plugins: [
    new WebpackObfuscator({
      rotateStringArray: true,
      stringArray: true,
      stringArrayEncoding: ['rc4'],
      stringArrayThreshold: 0.75
    }),
    new BytenodeWebpackPlugin({ compileForElectron: true })
  ],
  target: 'electron-main'
}

SamHoque avatar Jan 20 '24 08:01 SamHoque