diff options
| author | fat <[email protected]> | 2015-01-03 13:58:44 -0800 |
|---|---|---|
| committer | fat <[email protected]> | 2015-02-11 11:29:43 -0800 |
| commit | 834220ea20ce5b7cd31edfb624a28b4bf8b29a6a (patch) | |
| tree | 19bfdadb0c140df437e7b7034e5e1f5ce58343cc /Gruntfile.js | |
| parent | aed1cd31218113d67d2eca3296edf5d1700b19b8 (diff) | |
| download | bootstrap-834220ea20ce5b7cd31edfb624a28b4bf8b29a6a.tar.xz bootstrap-834220ea20ce5b7cd31edfb624a28b4bf8b29a6a.zip | |
bootstrap onto closure
Diffstat (limited to 'Gruntfile.js')
| -rw-r--r-- | Gruntfile.js | 68 |
1 files changed, 57 insertions, 11 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index fb9ec8202..38d6d20df 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -108,32 +108,78 @@ module.exports = function (grunt) { }, bootstrap: { src: [ - 'js/hover.js', - mq4HoverShim.featureDetector.umdGlobal, - 'js/transition.js', + 'js/util.js', 'js/alert.js', 'js/button.js', 'js/carousel.js', 'js/collapse.js', 'js/dropdown.js', 'js/modal.js', + 'js/scrollspy.js', 'js/tooltip.js', 'js/popover.js', - 'js/scrollspy.js', - 'js/tab.js', - 'js/affix.js' + 'js/tab.js' ], dest: 'dist/js/<%= pkg.name %>.js' } }, - uglify: { + closureCompiler: { + options: { - preserveComments: 'some' + compilerFile: require('superstartup-closure-compiler').getPath(), + checkModified: false, + + compilerOpts: { + // jscomp_warning: 'reportUnknownTypes', someday - maybe we will get to 100% typed, this helps track those down + compilation_level: 'ADVANCED_OPTIMIZATIONS', + warning_level: 'verbose', + summary_detail_level: 3, + output_wrapper: + '"<%= banner %><%= jqueryCheck %><%= jqueryVersionCheck %>' + + '(function($){%output%})(jQuery);"', + externs: 'js/externs/*.js' + }, + + execOpts: { + maxBuffer: 999999 * 1024 + }, + + // [OPTIONAL] Java VM optimization options + // see https://code.google.com/p/closure-compiler/wiki/FAQ#What_are_the_recommended_Java_VM_command-line_options? + // Setting one of these to 'true' is strongly recommended, + // and can reduce compile times by 50-80% depending on compilation size + // and hardware. + // On server-class hardware, such as with Github's Travis hook, + // TieredCompilation should be used; on standard developer hardware, + // d32 may be better. Set as appropriate for your environment. + // Default for both is 'false'; do not set both to 'true'. + d32: false, // will use 'java -client -d32 -jar compiler.jar' + TieredCompilation: false // will use 'java -server -XX:+TieredCompilation -jar compiler.jar' }, - core: { - src: '<%= concat.bootstrap.dest %>', + + targetName: { + src: [ + 'js/util.js', + 'js/alert.js', + 'js/button.js', + 'js/carousel.js', + 'js/collapse.js', + 'js/dropdown.js', + 'js/modal.js', + 'js/scrollspy.js', + 'js/tooltip.js', + 'js/popover.js', + 'js/tab.js' + ], dest: 'dist/js/<%= pkg.name %>.min.js' + } + + }, + + uglify: { + options: { + preserveComments: 'some' }, docsJs: { src: configBridge.paths.docsJs, @@ -388,7 +434,7 @@ module.exports = function (grunt) { grunt.registerTask('test-js', ['jshint:core', 'jshint:test', 'jshint:grunt', 'jscs:core', 'jscs:test', 'jscs:grunt', 'qunit']); // JS distribution task. - grunt.registerTask('dist-js', ['concat', 'uglify:core', 'commonjs']); + grunt.registerTask('dist-js', ['concat', 'closureCompiler', 'commonjs']); grunt.registerTask('test-scss', ['scsslint:scss']); |
