-
-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: only output when any chunk is fulfilled (#468)
- Loading branch information
1 parent
357d073
commit c7eda97
Showing
12 changed files
with
104 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
content: 'e1'; | ||
} |
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,3 @@ | ||
body { | ||
content: 'e2'; | ||
} |
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,3 @@ | ||
body { | ||
content: 'e3'; | ||
} |
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,3 @@ | ||
body { | ||
content: 'e4'; | ||
} |
16 changes: 16 additions & 0 deletions
16
test/cases/ignoreOrderFalseWithoutGoodChunks/expected/styles.css
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 @@ | ||
body { | ||
content: 'e1'; | ||
} | ||
|
||
body { | ||
content: 'e4'; | ||
} | ||
|
||
body { | ||
content: 'e2'; | ||
} | ||
|
||
body { | ||
content: 'e3'; | ||
} | ||
|
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 @@ | ||
import './e1.css'; |
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,2 @@ | ||
import './e2.css'; | ||
import './e1.css'; |
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,3 @@ | ||
import './e3.css'; | ||
import './e4.css'; | ||
import './e2.css'; |
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,3 @@ | ||
import './e4.css'; | ||
import './e2.css'; | ||
import './e3.css'; |
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,27 @@ | ||
const cssLoaderPath = require.resolve('css-loader').replace(/\\/g, '/'); | ||
|
||
module.exports = [ | ||
'', | ||
'WARNING in chunk styles [mini-css-extract-plugin]', | ||
'Conflicting order. Following module has been added:', | ||
` * css ${cssLoaderPath}!./e1.css`, | ||
'despite it was not able to fulfill desired ordering with these modules:', | ||
` * css ${cssLoaderPath}!./e2.css`, | ||
" - couldn't fulfill desired order of chunk group(s) entry2", | ||
'', | ||
'WARNING in chunk styles [mini-css-extract-plugin]', | ||
'Conflicting order. Following module has been added:', | ||
` * css ${cssLoaderPath}!./e4.css`, | ||
'despite it was not able to fulfill desired ordering with these modules:', | ||
` * css ${cssLoaderPath}!./e3.css`, | ||
" - couldn't fulfill desired order of chunk group(s) entry3", | ||
' - while fulfilling desired order of chunk group(s) entry4', | ||
'', | ||
'WARNING in chunk styles [mini-css-extract-plugin]', | ||
'Conflicting order. Following module has been added:', | ||
` * css ${cssLoaderPath}!./e2.css`, | ||
'despite it was not able to fulfill desired ordering with these modules:', | ||
` * css ${cssLoaderPath}!./e3.css`, | ||
" - couldn't fulfill desired order of chunk group(s) entry3", | ||
' - while fulfilling desired order of chunk group(s) entry4', | ||
].join('\n'); |
35 changes: 35 additions & 0 deletions
35
test/cases/ignoreOrderFalseWithoutGoodChunks/webpack.config.js
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 @@ | ||
import Self from '../../../src'; | ||
|
||
module.exports = { | ||
entry: { | ||
entry1: './index.js', | ||
entry2: './index2.js', | ||
entry3: './index3.js', | ||
entry4: './index4.js', | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: [Self.loader, 'css-loader'], | ||
}, | ||
], | ||
}, | ||
optimization: { | ||
splitChunks: { | ||
cacheGroups: { | ||
styles: { | ||
name: 'styles', | ||
chunks: 'all', | ||
test: /\.css$/, | ||
enforce: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
plugins: [ | ||
new Self({ | ||
ignoreOrder: false, | ||
}), | ||
], | ||
}; |