diff --git a/packages/@angular/cli/commands/build.ts b/packages/@angular/cli/commands/build.ts index e7b1bf4febb6..ebbdcafdacfb 100644 --- a/packages/@angular/cli/commands/build.ts +++ b/packages/@angular/cli/commands/build.ts @@ -148,15 +148,13 @@ const BuildCommand = Command.extend({ ]), run: function (commandOptions: BuildTaskOptions) { - const project = this.project; - // Check angular version. - Version.assertAngularVersionIs2_3_1OrHigher(project.root); + Version.assertAngularVersionIs2_3_1OrHigher(this.project.root); const BuildTask = require('../tasks/build').default; const buildTask = new BuildTask({ - cliProject: project, + project: this.project, ui: this.ui, }); diff --git a/packages/@angular/cli/commands/eject.ts b/packages/@angular/cli/commands/eject.ts index 016cfd564977..f4e625f8d2ce 100644 --- a/packages/@angular/cli/commands/eject.ts +++ b/packages/@angular/cli/commands/eject.ts @@ -32,10 +32,9 @@ const EjectCommand = Command.extend({ availableOptions: baseEjectCommandOptions, run: function (commandOptions: EjectTaskOptions) { - const project = this.project; const EjectTask = require('../tasks/eject').default; const ejectTask = new EjectTask({ - cliProject: project, + project: this.project, ui: this.ui, }); diff --git a/packages/@angular/cli/commands/init.ts b/packages/@angular/cli/commands/init.ts index ee44851f081b..a319dcd7ccd4 100644 --- a/packages/@angular/cli/commands/init.ts +++ b/packages/@angular/cli/commands/init.ts @@ -29,7 +29,6 @@ const InitCommand: any = Command.extend({ const InitTask = require('../tasks/init').default; const initTask = new InitTask({ - cliProject: this.project, project: this.project, tasks: this.tasks, ui: this.ui, diff --git a/packages/@angular/cli/tasks/build.ts b/packages/@angular/cli/tasks/build.ts index c984679c5c09..a7d092c4e661 100644 --- a/packages/@angular/cli/tasks/build.ts +++ b/packages/@angular/cli/tasks/build.ts @@ -15,20 +15,19 @@ const SilentError = require('silent-error'); export default Task.extend({ run: function (runTaskOptions: BuildTaskOptions) { - const project = this.cliProject; const config = CliConfig.fromProject().config; const app = getAppFromConfig(runTaskOptions.app); const outputPath = runTaskOptions.outputPath || app.outDir; - if (project.root === outputPath) { + if (this.project.root === outputPath) { throw new SilentError('Output path MUST not be project root directory!'); } if (config.project && config.project.ejected) { throw new SilentError('An ejected project cannot use the build command anymore.'); } if (runTaskOptions.deleteOutputPath) { - rimraf.sync(path.resolve(project.root, outputPath)); + rimraf.sync(path.resolve(this.project.root, outputPath)); } const webpackConfig = new NgCliWebpackConfig(runTaskOptions, app).buildConfig(); @@ -51,7 +50,7 @@ export default Task.extend({ const jsonStats = stats.toJson('verbose'); fs.writeFileSync( - path.resolve(project.root, outputPath, 'stats.json'), + path.resolve(this.project.root, outputPath, 'stats.json'), JSON.stringify(jsonStats, null, 2) ); } diff --git a/packages/@angular/cli/tasks/eject.ts b/packages/@angular/cli/tasks/eject.ts index a1f7f27b2630..a9b6349e64ad 100644 --- a/packages/@angular/cli/tasks/eject.ts +++ b/packages/@angular/cli/tasks/eject.ts @@ -386,7 +386,7 @@ class JsonWebpackSerializer { export default Task.extend({ run: function (runTaskOptions: EjectTaskOptions) { - const project = this.cliProject; + const project = this.project; const cliConfig = CliConfig.fromProject(); const config = cliConfig.config; const appConfig = getAppFromConfig(runTaskOptions.app);