Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uglify-es-loader

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uglify-es-loader

Uglify.js loader for webpack(fork from uglify-loader, using terser@3)

  • 3.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
537
decreased by-81%
Maintainers
1
Weekly downloads
 
Created
Source

uglify-es-loader

Uglify loader for webpack(fork from uglify-loader, using terser@3)

To install


npm i -D uglify-es-loader

Use Case


Webpack has UglifyJSPlugin that uglifies the output after bundling. In the applications that depend on thirdparty libraries you may want to uglify with mangling only your application code but not the code that you don't control.

Example


Webpack 1

module: {
    loaders: [
        {
            // I want to uglify with mangling only app files, not thirdparty libs
            test: /.*\/app\/.*\.js$/,
            exclude: /.spec.js/, // excluding .spec files
            loader: "uglify"
        }
    ]
}

You can pass UglifyJS parameters via 'uglify-es-loader' property of webpack config.

module: {
    loaders: [
        {
            // I want to uglify with mangling only app files, not thirdparty libs
            test: /.*\/app\/.*\.js$/,
            exclude: /.spec.js/, // excluding .spec files
            loader: "uglify"
        }
    ]
},
'uglify-es-loader': {
    mangle: false
}

Webpack 2

module: {
    rules: [
        {
            // I want to uglify with mangling only app files, not thirdparty libs
            test: /.*\/app\/.*\.js$/,
            exclude: /.spec.js/, // excluding .spec files
            use: 'uglify-es-loader'
        }
    ]
}

You can pass UglifyJS parameters via loader options.

module: {
    rules: [
        {
            // I want to uglify with mangling only app files, not thirdparty libs
            test: /.*\/app\/.*\.js$/,
            exclude: /.spec.js/, // excluding .spec files
            use: {
                loader: 'uglify-es-loader',
                options: {
                    mangle: false
                }
            }
        }
    ]
}

Enable sourceMap

{
    loader: 'uglify-es-loader',
    options: {
        enableSourceMap: true
    }
}

Update

  • 3.0.4

    Replaced uglify-es with terser.

Keywords

FAQs

Package last updated on 19 Nov 2018

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc