-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade dev middleware (#2660)
- Loading branch information
1 parent
eb9c58d
commit 8f6c8f4
Showing
37 changed files
with
779 additions
and
744 deletions.
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
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
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,15 @@ | ||
'use strict'; | ||
|
||
const getStatsOption = require('./getStatsOption'); | ||
|
||
function getColorsOption(configArr) { | ||
const statsOption = getStatsOption(configArr); | ||
let colors = false; | ||
if (typeof statsOption === 'object' && statsOption.colors) { | ||
colors = statsOption.colors; | ||
} | ||
|
||
return colors; | ||
} | ||
|
||
module.exports = getColorsOption; |
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,8 @@ | ||
'use strict'; | ||
|
||
function getCompilerConfigArray(compiler) { | ||
const compilers = compiler.compilers ? compiler.compilers : [compiler]; | ||
return compilers.map((comp) => comp.options); | ||
} | ||
|
||
module.exports = getCompilerConfigArray; |
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,16 @@ | ||
'use strict'; | ||
|
||
function getStatsOption(configArr) { | ||
const isEmptyObject = (val) => | ||
typeof val === 'object' && Object.keys(val).length === 0; | ||
|
||
// in webpack@4 stats will not be defined if not provided, | ||
// but in webpack@5 it will be an empty object | ||
const statsConfig = configArr.find( | ||
(conf) => | ||
typeof conf === 'object' && conf.stats && !isEmptyObject(conf.stats) | ||
); | ||
return statsConfig ? statsConfig.stats : {}; | ||
} | ||
|
||
module.exports = getStatsOption; |
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
Oops, something went wrong.