atma-io-middleware-uglify

1.1.25 • Public • Published

UglifyJS (Atma Plugin)

The Plugin extends:

  • atma-io with a custom middleware to write minified JavaScript to files
  • Atma Toolkit with a uglify action
How to use
Embed into the Project
  • atma plugin install atma-io-middleware-uglify

    This adds atma-loader-babel npm dependency and the package.json would look like:

        {
            "devDependencies": {
                "atma-io-middleware-uglify"
            },
            "atma": {
                "plugins": [
                    "atma-io-middleware-uglify"
                ],
                "settings": {
                    "atma-io-middleware-uglify": {
                        "minify" : true,
                        "defines": {} // override const variables,
                        "uglify": {} // override uglify js options
                    }
                }
            }
        }
  • Extend your build.js file

    module.exports = {
        // other actions
        'compress': {
            action: 'atma-io-middleware-uglify',
            files: [ 'source/lib.js' ],
            output: 'release/',
     
            // optionaly, define constants for the UglifyJS compressor
            defines: {
                DEBUG: false,
                SAFE: true,
                BROWSER: true,
                NODE: false
            }
        }
    }
  • Run

    $ atma compress

The MIT License

/atma-io-middleware-uglify/

    Package Sidebar

    Install

    npm i atma-io-middleware-uglify

    Weekly Downloads

    3

    Version

    1.1.25

    License

    MIT

    Unpacked Size

    7.82 kB

    Total Files

    3

    Last publish

    Collaborators

    • tenbits