Created
April 1, 2015 12:11
-
-
Save formigone/bd164f9bbb546854ef76 to your computer and use it in GitHub Desktop.
Gulp Closure Compiler - using closure library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// As of this writing, the example on https://github.com/steida/gulp-closure-compiler doesn't | |
// explain how to compile your project using Google's Closure Library. | |
// Since the newest version of the compiler doesn't need a deps file anymore, we just need | |
// to provide all our module definitions (files with goog.provide) to the task src. | |
gulp.task('build', function () { | |
// Specify where your Closure Library is stored --------------------------vvvv | |
gulp.src(['main.js', 'src/**/*.js', 'node_modules/closure-library/closure/goog/**/*.js']) | |
// Everything else is the same as in the docs | |
.pipe(closureCompiler({ | |
compilerPath: '/usr/local/google-closure/compiler.jar', | |
fileName: 'dist/build.js', | |
compilerFlags: { | |
closure_entry_point: 'rokko.main', | |
compilation_level: 'ADVANCED_OPTIMIZATIONS', | |
define: [ | |
"goog.DEBUG=false" | |
], | |
only_closure_dependencies: true, | |
warning_level: 'VERBOSE', | |
create_source_map: 'app.comp.js.map' | |
} | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment