JSPM

rollup-plugin-javascript-obfuscator

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1019
    • Score
      100M100P100Q115405F
    • License MIT

    Plugin for Rollup to obfuscate JS code

    Package Exports

    • rollup-plugin-javascript-obfuscator

    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-javascript-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-javascript-obfuscator

    Build Status Coverage Status

    Rollup plugin designed mainly for use with node-config (though you can pass any object you want).

    Installation

    Install the package:

    • npm npm install --save-dev rollup-plugin-javascript-obfuscator
    • yarn yarn add --dev rollup-plugin-javascript-obfuscator

    Usage

    Pass any object with a single root node to the plugin (it can be named anything you want).

    import { rollup } from 'rollup'
    import configPlugin from 'rollup-plugin-javascript-obfuscator'
    
        const configObject = {
            one: 1,
            two: 2,
            three: {
                four: 'four'
            }
        };
        
        rollup({
            entry: 'main.js',
            plugins: [
                configPlugin({CONFIG: configObject}) //Now you can use values like CONFIG.one or CONFIG.three.four in your code
            ]
        })
    

    Use that node name as a global variable in your script.

    console.log(CONFIG.one + CONFIG.two)

    It'll get replaced with an actual value from the object you provided.

    console.log(1 + 2)