Skip to content

Commit

Permalink
bumped to webpack 5
Browse files Browse the repository at this point in the history
  • Loading branch information
oguilleux committed Oct 16, 2020
1 parent 70a4ea0 commit 5af38b3
Show file tree
Hide file tree
Showing 7 changed files with 402 additions and 521 deletions.
3 changes: 0 additions & 3 deletions gulp/core/config/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ module.exports = deepMerge({
// for :prod task
prod: {
mode: 'production',
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(true),
],
optimization: {
minimize: true,
minimizer: [
Expand Down
3 changes: 2 additions & 1 deletion gulp/core/recipes/scripts/dev.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var named = require('vinyl-named');
var webpack = require('webpack');
var gulpWebpack = require('webpack-stream');
var browserSync = require('browser-sync');

Expand Down Expand Up @@ -31,7 +32,7 @@ module.exports = function () {
deepMerge(
config.options.webpack.defaults,
config.options.webpack.dev
), null, function (err, stats) {
), webpack, function (err, stats) {
logStats(err, stats);
// reload browser-sync when
// a package is updated
Expand Down
3 changes: 2 additions & 1 deletion gulp/core/recipes/scripts/prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var named = require('vinyl-named');
var webpack = require('webpack');
var gulpWebpack = require('webpack-stream');
var notify = require('gulp-notify');

Expand All @@ -27,7 +28,7 @@ module.exports = function () {
deepMerge(
config.options.webpack.defaults,
config.options.webpack.prod
)
), webpack
))

.pipe(gulp.dest(config.paths.dest))
Expand Down
8 changes: 4 additions & 4 deletions gulp/core/recipes/scripts/watch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var named = require('vinyl-named');
var webpack = require('webpack');
var gulpWebpack = require('webpack-stream');
var browserSync = require('browser-sync');

Expand All @@ -23,7 +24,7 @@ var config = require('../../config/scripts');
* @returns {*}
*/
module.exports = function (done) {
return gulp.src(config.paths.src)
gulp.src(config.paths.src)
.pipe(plumber())

.pipe(named()) // vinyl-named is used to allow for
Expand All @@ -32,16 +33,15 @@ module.exports = function (done) {
deepMerge(
config.options.webpack.defaults,
config.options.webpack.watch
), null, function (err, stats) {
), webpack, function (err, stats) {
logStats(err, stats, { watch: true });

// reload browser-sync when
// a package is updated
browserSync.reload();
notifaker(pumped('JS Packaged'));
})
})
)

.pipe(gulp.dest(config.paths.dest));

done();
Expand Down
Loading

0 comments on commit 5af38b3

Please sign in to comment.