JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10353
  • Score
    100M100P100Q135718F
  • License MPL-2.0

The most powerful rollup plugin for javascript-obfuscator

Package Exports

  • rollup-plugin-obfuscator
  • rollup-plugin-obfuscator/dist/rollup-plugin-obfuscator.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rollup-plugin-obfuscator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rollup-plugin-obfuscator

npm

The most powerful rollup plugin for javascript-obfuscator.

yarn add --dev rollup-plugin-obfuscator javascript-obfuscator

or

npm install --save-dev rollup-plugin-obfuscator javascript-obfuscator

Why was this plugin made?

  1. javascript-obfuscator is installed separately from the rollup plugin, so it will always be updatable
  2. with this plugin, you can decide if you prefer to apply obfuscation to: a. each file, to avoid obfuscating your open-source dependencies, which results in a huge performance boost b. the whole bundle

Usage

import obfuscator from 'rollup-plugin-obfuscator';

export default {
    input: 'src/main.js',
    plugins: [
        obfuscator({
            options: {
                // Your javascript-obfuscator options here
                // Will be applied on each file separately.
                // See what's allowed: https://github.com/javascript-obfuscator/javascript-obfuscator
            },
        }),
    ]
}

Options

global

Type: boolean
Default: false

Set to true if you want to obfuscate the whole bundle, false to obfuscate each file separately.

options

Type: Object
Default: {}

Options that will be passed to javascript-obfuscator. See allowed options here.

include

Type: String | Array[...String]
Default: ['**/*.js', '**/*.ts']

Which files to obfuscate with fileOptions.

exclude

Type: String | Array[...String]
Default: ['node_modules/**']

Which files to skip applying fileOptions on.

obfuscator

Type: JavascriptObfuscator
Default: require('javascript-obfuscator')

This plugin uses the version of javascript-obfuscator you installed alongside with it, but you are free to override it (for example, if you want to use a fork).