在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):basedRNC/gulp-closure-compiler-old开源软件地址(OpenSource Url):https://github.com/basedRNC/gulp-closure-compiler-old开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-closure-compiler-old
Issues with the output or Java should be reported on the Closure Compiler issue tracker. Install
ExampleSimple optimizationsSimple optimizations for classic minifying. var gulp = require('gulp');
var closureCompiler = require('gulp-closure-compiler-old');
gulp.task('default', function() {
gulp.src('src/*.js')
.pipe(closureCompiler({
compilerPath: 'bower_components/closure-compiler/compiler.jar',
fileName: 'build.js'
}))
.pipe(gulp.dest('dist'));
}); Advanced optimizationsAdvanced optimizations is much more aggressive. It's aimed for libraries like Closure Library. var gulp = require('gulp');
var closureCompiler = require('gulp-closure-compiler-old');
gulp.task('default', function() {
gulp.src('src/*.js')
.pipe(closureCompiler({
compilerPath: 'bower_components/closure-compiler/compiler.jar',
fileName: 'build.js',
compilerFlags: {
closure_entry_point: 'app.main',
compilation_level: 'ADVANCED_OPTIMIZATIONS',
define: [
"goog.DEBUG=false"
],
externs: [
'bower_components/este-library/externs/react.js'
],
extra_annotation_name: 'jsx',
only_closure_dependencies: true,
output_wrapper: '(function(){%output%})();',
warning_level: 'VERBOSE'
}
}))
.pipe(gulp.dest('dist'));
}); APIclosureCompiler(options)optionsfileNameType: Generated file name. compilerPathType: Path to compiler.jar compilerFlagsType: Closure compiler flags. Closure CompilerHow to downloadUse Bower. {
"name": "foo",
"version": "0.0.0",
"dependencies": {
"closure-compiler": "http://dl.google.com/closure-compiler/compiler-latest.zip"
}
} Implementation notes
LicenseMIT © Daniel Steigerwald |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论