Skip to content

Commit

Permalink
fix(build): don't leave dist folder on fail (#4047)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva authored Jan 25, 2017
1 parent 14666f4 commit 790dda6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"@types/rimraf": "0.0.25-alpha",
"@types/semver": "^5.3.30",
"@types/source-map": "^0.5.0",
"@types/webpack": "2.2.0",
"@types/webpack": "^2.2.1",
"chai": "^3.5.0",
"conventional-changelog": "^1.1.0",
"dtsgenerator": "^0.7.1",
Expand Down
1 change: 1 addition & 0 deletions packages/angular-cli/models/webpack-configs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
].concat(extraRules)
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new HtmlWebpackPlugin({
template: path.resolve(appRoot, appConfig.index),
filename: path.resolve(buildOptions.outputPath, appConfig.index),
Expand Down
6 changes: 4 additions & 2 deletions tests/e2e/tests/build/fail-build.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {ng} from '../../utils/process';
import {expectToFail} from '../../utils/utils';
import {deleteFile} from '../../utils/fs';
import {deleteFile, expectFileToExist} from '../../utils/fs';

export default function() {
return deleteFile('src/app/app.component.ts')
// This is supposed to fail since there's a missing file
.then(() => expectToFail(() => ng('build')));
.then(() => expectToFail(() => ng('build')))
// Failed builds don't leave behind dist/
.then(() => expectToFail(() => expectFileToExist('dist/')));
}

0 comments on commit 790dda6

Please sign in to comment.