File tree Expand file tree Collapse file tree 5 files changed +44
-1
lines changed
test/cases/at-import-in-entry Expand file tree Collapse file tree 5 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -989,6 +989,7 @@ class MiniCssExtractPlugin {
989
989
let content = module . content . toString ( ) ;
990
990
991
991
const readableIdentifier = module . readableIdentifier ( requestShortener ) ;
992
+ const startsWithAtRuleImport = / ^ @ i m p o r t u r l / . test ( content ) ;
992
993
993
994
if ( compilation . outputOptions . pathinfo ) {
994
995
// From https://github.com/webpack/webpack/blob/29eff8a74ecc2f87517b627dee451c2af9ed3f3f/lib/ModuleInfoHeaderPlugin.js#L191-L194
@@ -999,7 +1000,7 @@ class MiniCssExtractPlugin {
999
1000
content = headerStr + content ;
1000
1001
}
1001
1002
1002
- if ( / ^ @ i m p o r t u r l / . test ( content ) ) {
1003
+ if ( startsWithAtRuleImport ) {
1003
1004
// HACK for IE
1004
1005
// http://stackoverflow.com/a/14676665/1458162
1005
1006
if ( module . media ) {
Original file line number Diff line number Diff line change
1
+ body {
2
+ font-family : "Manrope" ;
3
+ }
Original file line number Diff line number Diff line change
1
+ @import url (https://fonts.googleapis.com/css2?family=Manrope:wght@500;800 & dis play= swap);
Original file line number Diff line number Diff line change
1
+ /*!****************************************************************!*\
2
+ !*** css ../../../node_modules/css-loader/dist/cjs.js!./b.css ***!
3
+ \****************************************************************/
4
+ @import url (https://fonts.googleapis.com/css2?family=Manrope:wght@500;800 & dis play= swap);
5
+ /*!****************************************************************!*\
6
+ !*** css ../../../node_modules/css-loader/dist/cjs.js!./a.css ***!
7
+ \****************************************************************/
8
+ body {
9
+ font-family : 'Manrope' ;
10
+ }
11
+
12
+ /*!********************************************************************!*\
13
+ !*** css ../../../node_modules/css-loader/dist/cjs.js!./b.css (1) ***!
14
+ \********************************************************************/
15
+
16
+
Original file line number Diff line number Diff line change
1
+ import Self from "../../../src" ;
2
+
3
+ module . exports = {
4
+ mode : "development" ,
5
+ entry : [ "./a.css" , "./b.css" ] ,
6
+ output : {
7
+ pathinfo : true ,
8
+ } ,
9
+ module : {
10
+ rules : [
11
+ {
12
+ test : / \. c s s $ / ,
13
+ use : [ Self . loader , "css-loader" ] ,
14
+ } ,
15
+ ] ,
16
+ } ,
17
+ plugins : [
18
+ new Self ( {
19
+ filename : "[name].css" ,
20
+ } ) ,
21
+ ] ,
22
+ } ;
You can’t perform that action at this time.
0 commit comments