Permalink
Browse files

fix(webpack): clean dist folder before build

au build --watch essentially does webpack --watch which doesn't clear the dist directory by itself, resulting in many files over time. This still happens, but it gets emptied before a new au build command is ran
  • Loading branch information...
JeroenVinke committed Aug 24, 2017
1 parent 3cfd956 commit 053ad98d9dad05ba16de861e57f010d863107d96
@@ -56,6 +56,7 @@ module.exports = function(project, options) {
'expose-loader',
'style-loader',
'url-loader',
'del',
'css-loader',
'nps-utils',
'file-loader',
View
@@ -39,6 +39,7 @@
"cross-env": "5.0.1",
"css-loader": "0.28.4",
"debounce": "^1.0.2",
"del": "^3.0.0",
"event-stream": "^3.3.3",
"expose-loader": "0.7.3",
"extract-text-webpack-plugin": "3.0.0",
@@ -4,6 +4,7 @@ import project from '../aurelia.json';
import {CLIOptions, Configuration} from 'aurelia-cli';
import gulp from 'gulp';
import configureEnvironment from './environment';
import del from 'del';
const buildOptions = new Configuration(project.build.options);
const production = CLIOptions.getEnvironment() === 'prod';
@@ -35,7 +36,12 @@ function onBuild(err, stats) {
}
}
function clearDist() {
return del([config.output.path]);
}
const build = gulp.series(
clearDist,
configureEnvironment,
buildWebpack
);
@@ -4,6 +4,7 @@ import * as project from '../aurelia.json';
import {CLIOptions, Configuration} from 'aurelia-cli';
import * as gulp from 'gulp';
import configureEnvironment from './environment';
import * as del from 'del';
const buildOptions = new Configuration(project.build.options);
const production = CLIOptions.getEnvironment() === 'prod';
@@ -35,7 +36,12 @@ function onBuild(err, stats) {
}
}
function clearDist() {
return del([config.output.path]);
}
const build = gulp.series(
clearDist,
configureEnvironment,
buildWebpack
);

0 comments on commit 053ad98

Please sign in to comment.