-
-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: respect
stats
from the config for webpack@4 (#2098)
- Loading branch information
1 parent
f6f4585
commit 2d6e5c6
Showing
5 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = [ | ||
{ | ||
watch: true, | ||
stats: 'none', | ||
}, | ||
{ | ||
watch: true, | ||
stats: 'none', | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('TEST'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict'; | ||
|
||
const { runWatch, isWebpack5 } = require('../../utils/test-utils'); | ||
|
||
describe('stats and watch', () => { | ||
it('should not log stats with the "none" value from the configuration', async () => { | ||
const { stderr, stdout } = await runWatch(__dirname, ['-c', './webpack.config.js', '--color']); | ||
|
||
expect(stdout).toContain('[webpack-cli] [32mCompilation starting...[39m'); | ||
expect(stdout).toContain('[webpack-cli] [32mCompilation finished[39m'); | ||
expect(stdout).toContain('[webpack-cli] [32mwatching files for updates...[39m'); | ||
expect(stderr).toBeFalsy(); | ||
}); | ||
|
||
it('should not log stats with the "none" value from the configuration and multi compiler mode', async () => { | ||
const { stderr, stdout } = await runWatch(__dirname, ['-c', './multi-webpack.config.js', '--color']); | ||
|
||
expect(stdout).toContain('[webpack-cli] [32mCompilation starting...[39m'); | ||
expect(stdout).toContain('[webpack-cli] [32mCompilation finished[39m'); | ||
expect(stdout).toContain('[webpack-cli] [32mwatching files for updates...[39m'); | ||
expect(stderr).toBeFalsy(); | ||
}); | ||
|
||
it('should log stats with the "normal" value in arguments', async () => { | ||
const { stderr, stdout } = await runWatch(__dirname, ['-c', './webpack.config.js', '--stats', 'normal', '--color']); | ||
|
||
const output = isWebpack5 ? 'successfully' : 'main.js'; | ||
|
||
expect(stdout).toContain('[webpack-cli] [32mCompilation starting...[39m'); | ||
expect(stdout).toContain('[webpack-cli] [32mCompilation finished[39m'); | ||
expect(stdout).toContain('[webpack-cli] [32mwatching files for updates...[39m'); | ||
expect(stdout).toContain(output); | ||
expect(stderr).toBeFalsy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
watch: true, | ||
stats: 'none', | ||
}; |