@@ -15,20 +15,19 @@ const SilentError = require('silent-error');
15
15
16
16
export default Task . extend ( {
17
17
run : function ( runTaskOptions : BuildTaskOptions ) {
18
- const project = this . cliProject ;
19
18
const config = CliConfig . fromProject ( ) . config ;
20
19
21
20
const app = getAppFromConfig ( runTaskOptions . app ) ;
22
21
23
22
const outputPath = runTaskOptions . outputPath || app . outDir ;
24
- if ( project . root === outputPath ) {
23
+ if ( this . project . root === outputPath ) {
25
24
throw new SilentError ( 'Output path MUST not be project root directory!' ) ;
26
25
}
27
26
if ( config . project && config . project . ejected ) {
28
27
throw new SilentError ( 'An ejected project cannot use the build command anymore.' ) ;
29
28
}
30
29
if ( runTaskOptions . deleteOutputPath ) {
31
- rimraf . sync ( path . resolve ( project . root , outputPath ) ) ;
30
+ rimraf . sync ( path . resolve ( this . project . root , outputPath ) ) ;
32
31
}
33
32
34
33
const webpackConfig = new NgCliWebpackConfig ( runTaskOptions , app ) . buildConfig ( ) ;
@@ -51,7 +50,7 @@ export default Task.extend({
51
50
const jsonStats = stats . toJson ( 'verbose' ) ;
52
51
53
52
fs . writeFileSync (
54
- path . resolve ( project . root , outputPath , 'stats.json' ) ,
53
+ path . resolve ( this . project . root , outputPath , 'stats.json' ) ,
55
54
JSON . stringify ( jsonStats , null , 2 )
56
55
) ;
57
56
}
0 commit comments