Skip to content

Commit

Permalink
refactor(app generator): transform build minification
Browse files Browse the repository at this point in the history
  • Loading branch information
cueedee committed Mar 18, 2015
1 parent cb17aa0 commit 50a3a61
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
33 changes: 24 additions & 9 deletions generators/app/templates/_Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
##
Expand Down Expand Up @@ -680,7 +695,7 @@ module.exports = ( grunt ) ->

'app:dist'

'uglify:dist'
'uglify:app'

'compress:app_dist'

Expand Down
5 changes: 4 additions & 1 deletion generators/app/templates/demo/views/buildscript.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<a href="https://github.com/jmreidy/grunt-browserify#readme">Browserify</a>:
compile and bundle your code
</li>
<li>Uglify: minify and uglify the bundle file</li>
<li>
<a href="https://github.com/gruntjs/grunt-contrib-copy#readme">Copy</a>:
copy your build bits that needs no transformation; your style assets and i18n files
Expand All @@ -35,6 +34,10 @@
<a href="https://github.com/mathiasbynens/grunt-template#readme">Template</a>:
substitute build targets and - for cache-busting reasons - a build-run identifier into your app's main entry point ('<code>index.html</code>')
</li>
<li>
<a href="https://github.com/gruntjs/grunt-contrib-uglify#readme">Uglify</a>:
minify your compiled and bundled code
</li>
<li>
<a href="https://github.com/gruntjs/grunt-contrib-yuidoc#readme">YuiDoc</a>:
generate your code's documentation
Expand Down

0 comments on commit 50a3a61

Please sign in to comment.