JSPM

uglifyjs-browser

3.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 71
    • Score
      100M100P100Q69688F

    Package Exports

    • uglifyjs-browser

    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 (uglifyjs-browser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    uglifyjs-browser CircleCI

    UglifyJS@v3 packaged for the browser.

    Why?

    I spent far too much time digging for this and just need something to minify javascript within a browser app. This module does exactly that.

    Versioning Notice

    Starting at v3, this package will mirror the major version of our underlying UglifyJS dependency. For example, v3.0.0 will use UglifyJS v3.X.X.

    Example

    const uglify = require('uglifyjs-browser')
    
    const src = `
      (function () {
        var foo = 'bar'
        var baz = 'qux'
        this.foo = foo + baz
      })()
    `
    
    const { code, error } = uglify.minify(src)
    if (error) {
      throw error
    }
    
    console.log(code)

    Updating the build

    Run the following, then push a new tag:

    yarn upgrade uglify-js
    yarn build
    vim package.json # bump version
    git release <version>

    CircleCI will handle publishing to npm.

    License

    MIT