UNPKG

rollup-obfuscator

Version:

A plugin to obfuscate javascript for rollup & vite based on https://www.npmjs.com/javascript-obfuscator

24 lines (21 loc) 955 B
import { ObfuscatorOptions } from 'javascript-obfuscator'; import { FilterPattern } from '@rollup/pluginutils'; import { Plugin } from 'rollup'; interface ObfuscatorPlugin extends Plugin { apply?: 'build' | 'serve'; enforce?: 'pre' | 'post'; } interface RollupObfuscatorOptions extends ObfuscatorOptions { /** * A [FilterPattern](https://github.com/rollup/plugins/blob/master/packages/pluginutils/types/index.d.ts#L23) of files to include. By default only allows js/ts files. * @default ['**\/*.js', '**\/*.ts'] */ include?: FilterPattern; /** * A [FilterPattern](https://github.com/rollup/plugins/blob/master/packages/pluginutils/types/index.d.ts#L23) of files to exclude. By default ignores node_modules. * @default ['node_modules\/**'] */ exclude?: FilterPattern; } declare function obfuscator(options?: RollupObfuscatorOptions): ObfuscatorPlugin; export { RollupObfuscatorOptions, obfuscator };