@@ -15,20 +15,19 @@ const SilentError = require('silent-error');
1515
1616export default Task . extend ( {
1717 run : function ( runTaskOptions : BuildTaskOptions ) {
18- const project = this . cliProject ;
1918 const config = CliConfig . fromProject ( ) . config ;
2019
2120 const app = getAppFromConfig ( runTaskOptions . app ) ;
2221
2322 const outputPath = runTaskOptions . outputPath || app . outDir ;
24- if ( project . root === outputPath ) {
23+ if ( this . project . root === outputPath ) {
2524 throw new SilentError ( 'Output path MUST not be project root directory!' ) ;
2625 }
2726 if ( config . project && config . project . ejected ) {
2827 throw new SilentError ( 'An ejected project cannot use the build command anymore.' ) ;
2928 }
3029 if ( runTaskOptions . deleteOutputPath ) {
31- rimraf . sync ( path . resolve ( project . root , outputPath ) ) ;
30+ rimraf . sync ( path . resolve ( this . project . root , outputPath ) ) ;
3231 }
3332
3433 const webpackConfig = new NgCliWebpackConfig ( runTaskOptions , app ) . buildConfig ( ) ;
@@ -51,7 +50,7 @@ export default Task.extend({
5150 const jsonStats = stats . toJson ( 'verbose' ) ;
5251
5352 fs . writeFileSync (
54- path . resolve ( project . root , outputPath , 'stats.json' ) ,
53+ path . resolve ( this . project . root , outputPath , 'stats.json' ) ,
5554 JSON . stringify ( jsonStats , null , 2 )
5655 ) ;
5756 }
0 commit comments