From ec0cdb5950bd327f209fb721c0bb6807a791f4b1 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Sun, 9 Oct 2016 20:35:40 +0100 Subject: [PATCH] fix(build): use outputPath from config Follow up from #2158 Fix #2511 Close #2611 --- packages/angular-cli/tasks/build-webpack-watch.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/angular-cli/tasks/build-webpack-watch.ts b/packages/angular-cli/tasks/build-webpack-watch.ts index 008168dac399..700c977298e4 100644 --- a/packages/angular-cli/tasks/build-webpack-watch.ts +++ b/packages/angular-cli/tasks/build-webpack-watch.ts @@ -6,6 +6,7 @@ const ProgressPlugin = require('webpack/lib/ProgressPlugin'); import { NgCliWebpackConfig } from '../models/webpack-config'; import { webpackOutputOptions } from '../models/'; import { BuildOptions } from '../commands/build'; +import { CliConfig } from '../models/config'; let lastHash: any = null; @@ -14,13 +15,14 @@ export default Task.extend({ const project = this.cliProject; - rimraf.sync(path.resolve(project.root, runTaskOptions.outputPath)); + const outputDir = runTaskOptions.outputPath || CliConfig.fromProject().config.apps[0].outDir; + rimraf.sync(path.resolve(project.root, outputDir)); const config = new NgCliWebpackConfig( project, runTaskOptions.target, runTaskOptions.environment, - runTaskOptions.outputPath, + outputDir, runTaskOptions.baseHref, runTaskOptions.aot ).config;