Skip to content

Commit 1e706a3

Browse files
update gulpfile.babel.js
1 parent bc83d46 commit 1e706a3

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

generators/app/templates/gulpfile.babel.js

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,25 @@ import config from './gulp/config';
44
const getTaskBuild = task => require('./gulp/tasks/' + task).build(gulp);
55
const getTaskWatch = task => require('./gulp/tasks/' + task).watch(gulp);
66

7-
8-
9-
10-
11-
127
gulp.task('clean', getTaskBuild('clean'));
138
gulp.task('copy', getTaskBuild('copy'));
14-
gulp.task('nunjucks', () => getTaskBuild('nunjucks'));
15-
gulp.task('sass', () => getTaskBuild('sass'));
169
gulp.task('server', () => getTaskBuild('server'));
17-
gulp.task('svgo', () => getTaskBuild('svgo'));
10+
<% if (templates === 'nunjucks') { %>gulp.task('nunjucks', () => getTaskBuild('nunjucks'));<% } %>
11+
<% if (templates === 'pug') { %>gulp.task('pug', () => getTaskBuild('pug'));<% } %>
12+
<% if (css === 'sass') { %>gulp.task('sass', () => getTaskBuild('sass'));<% } %>
13+
<% if (sprites.indexOf('svg') !== -1) { %>gulp.task('sprite:svg', () => getTaskBuild('sprite-svg'));<% } %>
14+
<% if (svgo) { %>gulp.task('svgo', () => getTaskBuild('svgo'));<% } %>
15+
<% if (preview) { %>gulp.task('list-pages', getTaskBuild('list-pages'));<% } %>
1816
gulp.task('webpack', getTaskBuild('webpack'));
19-
gulp.task('list-pages', getTaskBuild('list-pages'));
20-
gulp.task('sprite:svg', () => getTaskBuild('sprite-svg'));
2117

2218
gulp.task('copy:watch', getTaskWatch('copy'));
23-
gulp.task('nunjucks:watch', getTaskWatch('nunjucks'));
24-
gulp.task('sass:watch', getTaskWatch('sass'));
25-
gulp.task('svgo:watch', getTaskWatch('svgo'));
19+
<% if (templates === 'nunjucks') { %>gulp.task('nunjucks:watch', getTaskWatch('nunjucks'));<% } %>
20+
<% if (templates === 'pug') { %>gulp.task('pug:watch', () => getTaskWatch('pug'));<% } %>
21+
<% if (css === 'sass') { %>gulp.task('sass:watch', getTaskWatch('sass'));<% } %>
22+
<% if (sprites.indexOf('svg') !== -1) { %>gulp.task('sprite:svg:watch', getTaskWatch('sprite-svg'));<% } %>
23+
<% if (svgo) { %>gulp.task('svgo:watch', getTaskWatch('svgo'));<% } %>
24+
<% if (preview) { %>gulp.task('list-pages:watch', getTaskWatch('list-pages'));<% } %>
2625
gulp.task('webpack:watch', getTaskWatch('webpack'));
27-
gulp.task('list-pages:watch', getTaskWatch('list-pages'));
28-
gulp.task('sprite:svg:watch', getTaskWatch('sprite-svg'));
2926

3027
const setmodeProd = done => {
3128
config.setEnv('production');
@@ -35,7 +32,7 @@ const setmodeProd = done => {
3532

3633
const setmodeDev = done => {
3734
config.setEnv('development');
38-
config.logEnv();
35+
config.logEnv();
3936
done();
4037
}
4138

@@ -50,9 +47,9 @@ gulp.task(
5047
<% if (templates === 'nunjucks') { %>'nunjucks',<% } %>
5148
<% if (templates === 'pug') { %>'pug',<% } %>
5249
'webpack',
53-
'copy',
54-
<% if (preview) { %>'list-pages'<% } %>
55-
)
50+
<% if (preview) { %>'list-pages',<% } %>
51+
'copy'
52+
)
5653
);
5754

5855
gulp.task(

0 commit comments

Comments
 (0)