getkey / rollup-plugin-obfuscator

The most powerful rollup plugin for javascript-obfuscator.
Mozilla Public License 2.0
112 stars 9 forks source link

Simplify API #14

Closed getkey closed 1 year ago

getkey commented 1 year ago

As demonstrated in #13, the current API is confusing. fileOptions should be the default, as you rarely want to use globalOptions. Options could be applied globally using a boolean flag. Something like:

obfuscator({
    global: false,
    options: {
        // js-obfuscator options here
    },
}),

And if you want to use js-obfuscator both locally and globally, you still can. Just use the plugin twice: once with global set to true, once with false.