Socket
Socket
Sign inDemoInstall

rollup-plugin-obfuscator

Package Overview
Dependencies
94
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rollup-plugin-obfuscator

The most powerful rollup plugin for javascript-obfuscator


Version published
Maintainers
1
Created

Readme

Source

rollup-plugin-obfuscator

The most powerful rollup plugin for javascript-obfuscator.

$ yarn add rollup-plugin-obfuscator javascript-obfuscator

You also need to install javascript-obfuscator alongside or this plugin won't work.

Why?

There is already a plugin for this, but it's outdated and not powerful enough for me.

I'm not saying I'll be any better at maintaining this plugin, but the advantage of it is that you manage your version of javascript-obfuscator yourself.

Additionally, the other niceties are that you can apply obfuscation settings:

  • per file
  • to the whole bundle

The point is that you can avoid obfuscating your open-source dependencies, which results in a huge performance boost.

Usage

import obfuscator from 'rollup-plugin-obfuscator';

export default {
	input: 'src/main.js',
	plugins: [
		obfuscator({
			// options that will be passed to javascript-obfuscator
			// when it processes each file
			// see allowed options here https://github.com/javascript-obfuscator/javascript-obfuscator
			fileOptions: {
				// your options here
			},

			// options that will be passed to javascript-obfuscator
			// when it processes the whole bundle
			// see allowed options here https://github.com/javascript-obfuscator/javascript-obfuscator
			// if you don't want to apply the obfuscation to the whole bundle, you can set this to `false`
			globalOptions: {
				// your options here
			},

			// on which files to apply the `fileOptions`
			include: ['**/*.js', '**/*.ts'],

			// on which files not to apply the `fileOptions`
			exclude: ['node_modules/**'],

			// this plugin supplies javascript-obfuscator but you are free to override it if you want
			obfuscator: require('javascript-obfuscator'), 
		}),
	]
}

Note that a couple javascript-obfuscator options are forced. This is necessary for this plugin to work. Check out which ones you can't use here.

FAQs

Last updated on 08 Oct 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc