Skip to content

Commit 3099786

Browse files
committed
perf(gulp): lazy-load webpack config
1 parent 6759d8d commit 3099786

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates/app/gulpfile.babel.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ import makeWebpackConfig from './webpack.make';
2222

2323
var plugins = gulpLoadPlugins();
2424
var config;
25-
const webpackDevConfig = makeWebpackConfig({ DEV: true });
26-
const webpackE2eConfig = makeWebpackConfig({ E2E: true });
27-
const webpackDistConfig = makeWebpackConfig({ BUILD: true });
28-
const webpackTestConfig = makeWebpackConfig({ TEST: true });
2925

3026
const clientPath = 'client';
3127
const serverPath = 'server';
@@ -242,6 +238,7 @@ gulp.task('inject:<%= styleExt %>', () => {
242238
});<% } %>
243239

244240
gulp.task('webpack:dev', function() {
241+
const webpackDevConfig = makeWebpackConfig({ DEV: true });
245242
return gulp.src(webpackDevConfig.entry.app)
246243
.pipe(plugins.plumber())
247244
.pipe(webpack(webpackDevConfig))
@@ -250,18 +247,21 @@ gulp.task('webpack:dev', function() {
250247
});
251248

252249
gulp.task('webpack:dist', function() {
250+
const webpackDistConfig = makeWebpackConfig({ BUILD: true });
253251
return gulp.src(webpackDistConfig.entry.app)
254252
.pipe(webpack(webpackDistConfig))
255253
.pipe(gulp.dest(`${paths.dist}/client`));
256254
});
257255

258256
gulp.task('webpack:test', function() {
257+
const webpackTestConfig = makeWebpackConfig({ TEST: true });
259258
return gulp.src(webpackTestConfig.entry.app)
260259
.pipe(webpack(webpackTestConfig))
261260
.pipe(gulp.dest('.tmp'));
262261
});
263262

264263
gulp.task('webpack:e2e', function() {
264+
const webpackE2eConfig = makeWebpackConfig({ E2E: true });
265265
return gulp.src(webpackE2eConfig.entry.app)
266266
.pipe(webpack(webpackE2eConfig))
267267
.pipe(gulp.dest('.tmp'));

0 commit comments

Comments
 (0)