Socket
Book a DemoInstallSign in
Socket

esmangle-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esmangle-webpack-plugin

A minifier for Webpack based on ESMangle

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

ESMangle Webpack Plugin

NPM

A minifier for Webpack based on ESMangle.

Almost as effective as the Uglify plugin whilst significantly faster.

Use this plugin all the time so that you are developing the same code that you will deploy. Avoid surprises in production, particularly with Angular based projects.

Usage

var ESMangleWebpackPlugin = require('esmangle-webpack-plugin');
{
  plugins : [
    new ESMangleWebpackPlugin()
  ]
}

It is possible to pass options to the constructor, but this is normally not required. By default the plugin will produce a compressed output for all .js files.

How it works

Esprima parses the code into an Abstract Syntax Tree (AST). This is passed to esmangle which renames variables but does not compress the code. The AST is rendered back to Javascript by applying escodegen with options.format.

The default constructor is equivalent to the following.

new ESMangleWebpackPlugin({
	test  : /\.js($|\?)/i,
	format: {
		renumber   : true,
		hexadecimal: true,
		escapeless : true,
		compact    : true,
		semicolons : false,
		parentheses: false
	}
})

Keywords

webpack

FAQs

Package last updated on 03 Sep 2015

Did you know?

Socket

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