Edit Page

tasks/config/uglify.js

This file configures a Grunt task called "uglify".

Its job is to minify client-side JavaScript files. Internally, it uses UglifyES.

Usage

#

For additional usage documentation, see grunt-contrib-uglify.

ES8 and beyond

#

The default package is capable of minifying JavaScript written using ES6, ES7, and ES8 syntax and features, even without transpiling. However, if you're planning on supporting older browsers that don't support ES6, it's recommended that you still transpile your code (by leaving the default babel and polyfill tasks in place).

Want to see for yourself?

An example of this file can be found in our sample app repo, here.

Anatomy of a Sails App