18
18
import gulp from 'gulp' ;
19
19
import gulpAngularTemplatecache from 'gulp-angular-templatecache' ;
20
20
import gulpClosureCompiler from 'gulp-closure-compiler' ;
21
+ import gulpEslint from 'gulp-eslint' ;
21
22
import gulpMinifyHtml from 'gulp-minify-html' ;
22
23
import lodash from 'lodash' ;
23
24
import path from 'path' ;
@@ -38,11 +39,11 @@ const closureCompilerBaseConfig = {
38
39
js_module_root : conf . paths . frontendSrc ,
39
40
language_in : 'ECMASCRIPT6_STRICT' ,
40
41
language_out : 'ECMASCRIPT3' ,
41
- manage_closure_dependencies : true
42
+ manage_closure_dependencies : true ,
42
43
} ,
43
44
compilerPath : path . join ( conf . paths . nodeModules , 'google-closure-compiler/compiler.jar' ) ,
44
45
// This makes the compiler faster. Requires Java 7+.
45
- tieredCompilation : true
46
+ tieredCompilation : true ,
46
47
} ;
47
48
48
49
@@ -66,8 +67,8 @@ gulp.task('scripts', ['create-serve-folders'], function() {
66
67
// Make source map URLs relative to frontend source directory.
67
68
source_map_location_mapping : path . relative ( conf . paths . base , conf . paths . frontendSrc ) + '|' ,
68
69
// Include source map in the output bundle.
69
- output_wrapper : '%output%\n//# sourceMappingURL=' + `${ bundleBaseName } .js.map`
70
- }
70
+ output_wrapper : '%output%\n//# sourceMappingURL=' + `${ bundleBaseName } .js.map` ,
71
+ } ,
71
72
} , closureCompilerBaseConfig ) ;
72
73
73
74
return gulp . src ( path . join ( conf . paths . frontendSrc , '**/*.js' ) )
@@ -81,8 +82,6 @@ gulp.task('scripts', ['create-serve-folders'], function() {
81
82
* directory.
82
83
*/
83
84
gulp . task ( 'scripts:prod' , [ 'angular-templates' ] , function ( ) {
84
- let bundleBaseName = 'app' ;
85
-
86
85
let closureCompilerConfig = lodash . merge ( {
87
86
fileName : 'app.js' ,
88
87
compilerFlags : {
@@ -103,10 +102,10 @@ gulp.task('scripts', ['create-serve-folders'], function() {
103
102
// This check does not work correctly with ES6.
104
103
'inferredConstCheck' ,
105
104
// Let ESLint handle all lint checks.
106
- 'lintChecks'
105
+ 'lintChecks' ,
107
106
] ,
108
- use_types_for_optimization : null
109
- }
107
+ use_types_for_optimization : null ,
108
+ } ,
110
109
} , closureCompilerBaseConfig ) ;
111
110
112
111
return gulp . src ( [
@@ -116,7 +115,7 @@ gulp.task('scripts', ['create-serve-folders'], function() {
116
115
path . join ( conf . paths . partials , '**/*.js' ) ,
117
116
// Include base.js to enable some compiler functions, e.g., @export annotation handling.
118
117
path . join ( conf . paths . bowerComponents ,
119
- 'google-closure-library/closure/goog/base.js' )
118
+ 'google-closure-library/closure/goog/base.js' ) ,
120
119
] )
121
120
. pipe ( gulpClosureCompiler ( closureCompilerConfig ) )
122
121
. pipe ( gulp . dest ( conf . paths . prodTmp ) ) ;
@@ -131,10 +130,10 @@ gulp.task('angular-templates', function () {
131
130
. pipe ( gulpMinifyHtml ( {
132
131
empty : true ,
133
132
spare : true ,
134
- quotes : true
133
+ quotes : true ,
135
134
} ) )
136
135
. pipe ( gulpAngularTemplatecache ( 'angular-templates.js' , {
137
- module : conf . frontend . rootModuleName
136
+ module : conf . frontend . rootModuleName ,
138
137
} ) )
139
138
. pipe ( gulp . dest ( conf . paths . partials ) ) ;
140
139
} ) ;
0 commit comments