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
@@ -31,9 +31,7 @@ export default Task.extend({
31
31
) . config ;
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 ( {
@@ -53,7 +51,7 @@ export default Task.extend({
53
51
54
52
if ( stats . hash !== lastHash ) {
55
53
lastHash = stats . hash ;
56
- process . stdout . write ( stats . toString ( statsOptions ) + '\n' ) ;
54
+ process . stdout . write ( stats . toString ( statsConfig ) + '\n' ) ;
57
55
}
58
56
} ) ;
59
57
} ) ;
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;
@@ -32,9 +32,7 @@ export default <any>Task.extend({
32
32
33
33
const webpackCompiler : any = webpack ( config ) ;
34
34
35
- const statsOptions = runTaskOptions . verbose
36
- ? Object . assign ( webpackOutputOptions , verboseWebpackOutputOptions )
37
- : webpackOutputOptions ;
35
+ const statsConfig = getWebpackStatsConfig ( runTaskOptions . verbose ) ;
38
36
39
37
if ( runTaskOptions . progress ) {
40
38
webpackCompiler . apply ( new ProgressPlugin ( {
@@ -53,7 +51,7 @@ export default <any>Task.extend({
53
51
54
52
if ( stats . hash !== lastHash ) {
55
53
lastHash = stats . hash ;
56
- process . stdout . write ( stats . toString ( statsOptions ) + '\n' ) ;
54
+ process . stdout . write ( stats . toString ( statsConfig ) + '\n' ) ;
57
55
}
58
56
59
57
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' ;
@@ -39,9 +39,7 @@ export default Task.extend({
39
39
) ;
40
40
webpackCompiler = webpack ( config ) ;
41
41
42
- const statsOptions = serveTaskOptions . verbose
43
- ? Object . assign ( webpackOutputOptions , verboseWebpackOutputOptions )
44
- : webpackOutputOptions ;
42
+ const statsConfig = getWebpackStatsConfig ( serveTaskOptions . verbose ) ;
45
43
46
44
if ( serveTaskOptions . progress ) {
47
45
webpackCompiler . apply ( new ProgressPlugin ( {
@@ -84,7 +82,7 @@ export default Task.extend({
84
82
disableDotRule : true ,
85
83
htmlAcceptHeaders : [ 'text/html' , 'application/xhtml+xml' ]
86
84
} ,
87
- stats : statsOptions ,
85
+ stats : statsConfig ,
88
86
inline : true ,
89
87
proxy : proxyConfig ,
90
88
compress : serveTaskOptions . target === 'production' ,
You can’t perform that action at this time.
0 commit comments