Skip to content

Commit f849caf

Browse files
stillesjoAwk34
authored andcommitted
Constant task for gulp template file
1 parent 7e9b5f2 commit f849caf

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Diff for: app/templates/_package.json

+2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
"gulp-minify-css": "^1.1.6",
5858
"gulp-mocha": "^2.1.3",
5959
"gulp-ng-annotate": "^1.1.0",
60+
"gulp-ng-constant": "^1.1.0",
6061
"gulp-plumber": "^1.0.1",
62+
"gulp-rename": "^1.2.2",
6163
"gulp-rev": "^5.0.0",
6264
"gulp-rev-replace": "^0.4.2",
6365
"gulp-sort": "^1.1.1",

Diff for: app/templates/gulpfile.babel(gulp).js

+16-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ gulp.task('watch', () => {
258258
});
259259

260260
gulp.task('serve', cb => {
261-
runSequence(['clean:tmp', 'lint:scripts', 'inject'],
261+
runSequence(['clean:tmp', 'constant'],
262+
['lint:scripts', 'inject'],
262263
['wiredep:client'],<% if(filters.babel || filters.coffee) { %>
263264
['transpile:client', 'styles'],<% } else { %>
264265
'styles',<% } %>
@@ -408,6 +409,20 @@ gulp.task('html', function () {
408409
.pipe(gulp.dest('.tmp'));
409410
});
410411

412+
gulp.task('constant', function() {
413+
var config = require('./server/config/environment/shared');
414+
plugins.ngConstant({
415+
name: 'tempApp.constants',
416+
deps: [],
417+
wrap: true,
418+
stream: true,
419+
constants: config,
420+
}).pipe(plugins.rename({
421+
basename: 'app.constant',
422+
}))
423+
.pipe(gulp.dest('client/app/'))
424+
})
425+
411426
gulp.task('build:images', () => {
412427
return gulp.src('client/assets/images/**/*')
413428
.pipe(plugins.imagemin({

0 commit comments

Comments
 (0)