Obfuscate your JavaScript files when bundling with Snowpack.
npm i -D snowpack-javascript-obfuscator
Option | Type | Description |
---|---|---|
filesToObfuscate |
array | An array of files to obfuscate, relative to your public directory. |
jsObfuscatorOpts |
object | javascript-obfuscator options, reference: https://www.npmjs.com/package/javascript-obfuscator |
snowpack.config.js
module.exports = {
// ...
plugins: [
// ...
[
"snowpack-javascript-obfuscator",
{
filesToObfuscate: ["app.js", "utils.js"],
jsObfuscatorOpts: {
splitStrings: true,
stringArray: true,
stringArrayEncoding: ["base64"],
},
},
],
],
// ...
};