I have this config:
import ts from "@rollup/plugin-typescript";
import { uglify } from "rollup-plugin-uglify";
import obfuscator from "rollup-plugin-javascript-obfuscator";
export default {
input: "src/index.ts",
output: [
{
file: "dist/bundle.js",
format: "cjs",
},
{
file: "dist/ugly-bundle.js",
format: "cjs",
plugins: [uglify()],
},
{
file: "dist/obfuscate-bundle.js",
format: "cjs",
plugins: [obfuscator({ compact: true })],
},
],
plugins: [ts()],
};
And am trying to obfuscate a my files. The problem is, All other plugins work, but obfuscator doesn't. And I have no clue why. I tried removing the {compact}
options, but no difference. It just transpiles the code, so the obfuscate-bundle.js
is the same as bundle.js
. ugly-bundle.js
is in one line, and minified.
What am I missing?
I'm using this package: https://github.com/javascript-obfuscator/rollup-plugin-javascript-obfuscator