This repository was archived by the owner on Sep 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
packages/google-closure-compiler/docs Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Task targets, files and options may be specified according to the grunt
6
6
Include the plugin in your Gruntfile.js:
7
7
8
8
``` js
9
- import {grunt as gruntPlugin } from ' google-closure-compiler' ;
9
+ import {CONTRIB_PATH , grunt as gruntPlugin } from ' google-closure-compiler' ;
10
10
11
11
gruntPlugin (grunt, {
12
12
platform: [' native' , ' java' ],
@@ -39,6 +39,8 @@ grunt.initConfig({
39
39
' dest/output.min.js' : [' src/js/**/*.js' ]
40
40
},
41
41
options: {
42
+ js: ' /node_modules/google-closure-library/**.js' ,
43
+ externs: ` ${ CONTRIB_PATH } /externs/jquery-1.9.js` ,
42
44
compilation_level: ' SIMPLE' ,
43
45
language_in: ' ECMASCRIPT5_STRICT' ,
44
46
create_source_map: ' dest/output.min.js.map' ,
Original file line number Diff line number Diff line change @@ -88,7 +88,19 @@ be allocated. Both the grunt and gulp plugins support this.
88
88
``` js
89
89
import {gulp as closureCompiler } from ' google-closure-compiler' ;
90
90
91
- closureCompiler ({
92
- extraArguments: [' -Xms2048m' ]
91
+ gulp .task (' js-compile' , function () {
92
+ return gulp .src (' ./src/js/**/*.js' , {base: ' ./' })
93
+ .pipe (closureCompiler ({
94
+ compilation_level: ' SIMPLE' ,
95
+ warning_level: ' VERBOSE' ,
96
+ language_in: ' ECMASCRIPT6_STRICT' ,
97
+ language_out: ' ECMASCRIPT5_STRICT' ,
98
+ output_wrapper: ' (function(){\n %output%\n }).call(this)' ,
99
+ js_output_file: ' output.min.js'
100
+ }, {
101
+ extraArguments: [' -Xms2048m' ]
102
+ }))
103
+ .pipe (gulp .dest (' ./dist/js' ));
93
104
});
105
+
94
106
```
You can’t perform that action at this time.
0 commit comments