File tree Expand file tree Collapse file tree 4 files changed +17
-17
lines changed Expand file tree Collapse file tree 4 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ export const ngAppResolve = (resolvePath: string): string => {
4
4
return path . resolve ( process . cwd ( ) , resolvePath ) ;
5
5
} ;
6
6
7
- export const webpackOutputOptions = {
7
+ const webpackOutputOptions = {
8
8
colors : true ,
9
9
hash : true ,
10
10
timings : true ,
@@ -18,10 +18,16 @@ export const webpackOutputOptions = {
18
18
version : false
19
19
} ;
20
20
21
- export const verboseWebpackOutputOptions = {
21
+ const verboseWebpackOutputOptions = {
22
22
children : true ,
23
23
assets : true ,
24
24
version : true ,
25
25
reasons : true ,
26
26
chunkModules : false // TODO: set to true when console to file output is fixed
27
27
} ;
28
+
29
+ export function getWebpackStatsConfig ( verbose = false ) {
30
+ return verbose
31
+ ? Object . assign ( webpackOutputOptions , verboseWebpackOutputOptions )
32
+ : webpackOutputOptions ;
33
+ }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const Task = require('../ember-cli/lib/models/task');
4
4
import * as webpack from 'webpack' ;
5
5
const ProgressPlugin = require ( 'webpack/lib/ProgressPlugin' ) ;
6
6
import { NgCliWebpackConfig } from '../models/webpack-config' ;
7
- import { webpackOutputOptions , verboseWebpackOutputOptions } from '../models/' ;
7
+ import { getWebpackStatsConfig } from '../models/' ;
8
8
import { BuildOptions } from '../commands/build' ;
9
9
import { CliConfig } from '../models/config' ;
10
10
@@ -30,9 +30,7 @@ export default Task.extend({
30
30
) . config ;
31
31
const webpackCompiler : any = webpack ( config ) ;
32
32
33
- const statsOptions = runTaskOptions . verbose
34
- ? Object . assign ( webpackOutputOptions , verboseWebpackOutputOptions )
35
- : webpackOutputOptions ;
33
+ const statsConfig = getWebpackStatsConfig ( runTaskOptions . verbose ) ;
36
34
37
35
if ( runTaskOptions . progress ) {
38
36
webpackCompiler . apply ( new ProgressPlugin ( {
@@ -52,7 +50,7 @@ export default Task.extend({
52
50
53
51
if ( stats . hash !== lastHash ) {
54
52
lastHash = stats . hash ;
55
- process . stdout . write ( stats . toString ( statsOptions ) + '\n' ) ;
53
+ process . stdout . write ( stats . toString ( statsConfig ) + '\n' ) ;
56
54
}
57
55
} ) ;
58
56
} ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import * as webpack from 'webpack';
5
5
const ProgressPlugin = require ( 'webpack/lib/ProgressPlugin' ) ;
6
6
import { BuildOptions } from '../commands/build' ;
7
7
import { NgCliWebpackConfig } from '../models/webpack-config' ;
8
- import { webpackOutputOptions , verboseWebpackOutputOptions } from '../models/' ;
8
+ import { getWebpackStatsConfig } from '../models/' ;
9
9
import { CliConfig } from '../models/config' ;
10
10
11
11
// Configure build and output;
@@ -31,9 +31,7 @@ export default <any>Task.extend({
31
31
32
32
const webpackCompiler : any = webpack ( config ) ;
33
33
34
- const statsOptions = runTaskOptions . verbose
35
- ? Object . assign ( webpackOutputOptions , verboseWebpackOutputOptions )
36
- : webpackOutputOptions ;
34
+ const statsConfig = getWebpackStatsConfig ( runTaskOptions . verbose ) ;
37
35
38
36
if ( runTaskOptions . progress ) {
39
37
webpackCompiler . apply ( new ProgressPlugin ( {
@@ -52,7 +50,7 @@ export default <any>Task.extend({
52
50
53
51
if ( stats . hash !== lastHash ) {
54
52
lastHash = stats . hash ;
55
- process . stdout . write ( stats . toString ( statsOptions ) + '\n' ) ;
53
+ process . stdout . write ( stats . toString ( statsConfig ) + '\n' ) ;
56
54
}
57
55
58
56
return stats . hasErrors ( ) ? reject ( ) : resolve ( ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const Task = require('../ember-cli/lib/models/task');
6
6
import * as webpack from 'webpack' ;
7
7
const WebpackDevServer = require ( 'webpack-dev-server' ) ;
8
8
const ProgressPlugin = require ( 'webpack/lib/ProgressPlugin' ) ;
9
- import { webpackOutputOptions , verboseWebpackOutputOptions } from '../models/' ;
9
+ import { getWebpackStatsConfig } from '../models/' ;
10
10
import { NgCliWebpackConfig } from '../models/webpack-config' ;
11
11
import { ServeTaskOptions } from '../commands/serve' ;
12
12
import { CliConfig } from '../models/config' ;
@@ -38,9 +38,7 @@ export default Task.extend({
38
38
) ;
39
39
webpackCompiler = webpack ( config ) ;
40
40
41
- const statsOptions = serveTaskOptions . verbose
42
- ? Object . assign ( webpackOutputOptions , verboseWebpackOutputOptions )
43
- : webpackOutputOptions ;
41
+ const statsConfig = getWebpackStatsConfig ( serveTaskOptions . verbose ) ;
44
42
45
43
if ( serveTaskOptions . progress ) {
46
44
webpackCompiler . apply ( new ProgressPlugin ( {
@@ -83,7 +81,7 @@ export default Task.extend({
83
81
disableDotRule : true ,
84
82
htmlAcceptHeaders : [ 'text/html' , 'application/xhtml+xml' ]
85
83
} ,
86
- stats : statsOptions ,
84
+ stats : statsConfig ,
87
85
inline : true ,
88
86
proxy : proxyConfig ,
89
87
compress : serveTaskOptions . target === 'production' ,
You can’t perform that action at this time.
0 commit comments