diff --git a/generators/app/templates/_Gruntfile.coffee b/generators/app/templates/_Gruntfile.coffee index 2dc7f801..64a355b3 100644 --- a/generators/app/templates/_Gruntfile.coffee +++ b/generators/app/templates/_Gruntfile.coffee @@ -34,6 +34,10 @@ ## * debugging, - alias debug ## * non-debugging, - alias dist - note the overloading of the 'dist' term. ## +## * The build packing: +## * as-is +## * minified - alias uglified +## ## * The build tools. These almost map 1-to-1 on the npm-loaded grunt tasks: ## ## * browserify - for the app build part @@ -42,6 +46,7 @@ ## * compress - for the application and documentation build artifacts ## * copy ## * template - for the bootstrap build part +## * uglify ## * yuidoc - for the documentation build part ## ## The above all have to do with the actual assembly of the build. @@ -377,14 +382,6 @@ module.exports = ( grunt ) -> ] - # Optimize the JavaScript code - # - uglify: - dist: - files: - 'dist/app/bundle.js': [ 'dist/app/bundle.js' ] - - mochaTest: test: options: @@ -429,6 +426,24 @@ module.exports = ( grunt ) -> ] + ## + ## Minify your compiled and bundled code. + ## + ## https://github.com/gruntjs/grunt-contrib-uglify#readme + ## + ## https://github.com/mishoo/UglifyJS2#readme + ## http://lisperator.net/uglifyjs/ + ## + + uglify: + + app: + files: [ + src: '<%= build.part.app.tgt %>' + dest: '<%= build.part.app.tgt %>' + ] + + ## ## https://github.com/gruntjs/grunt-contrib-watch#readme ## @@ -680,7 +695,7 @@ module.exports = ( grunt ) -> 'app:dist' - 'uglify:dist' + 'uglify:app' 'compress:app_dist' diff --git a/generators/app/templates/demo/views/buildscript.hbs b/generators/app/templates/demo/views/buildscript.hbs index 0c2783c0..99af5091 100644 --- a/generators/app/templates/demo/views/buildscript.hbs +++ b/generators/app/templates/demo/views/buildscript.hbs @@ -18,7 +18,6 @@ Browserify: compile and bundle your code -
  • Uglify: minify and uglify the bundle file
  • Copy: copy your build bits that needs no transformation; your style assets and i18n files @@ -35,6 +34,10 @@ Template: substitute build targets and - for cache-busting reasons - a build-run identifier into your app's main entry point ('index.html')
  • +
  • + Uglify: + minify your compiled and bundled code +
  • YuiDoc: generate your code's documentation