@@ -13,14 +13,15 @@ const makeSerializable = require("./util/makeSerializable");
1313/** @typedef {import("./RequestShortener") } RequestShortener */
1414/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext } ObjectDeserializerContext */
1515/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext } ObjectSerializerContext */
16+ /** @typedef {import("../declarations/WebpackOptions").CssParserExportType } CssParserExportType */
1617
1718/** @typedef {string | undefined } CssLayer */
1819/** @typedef {string | undefined } Supports */
1920/** @typedef {string | undefined } Media */
2021/** @typedef {[CssLayer, Supports, Media] } InheritanceItem */
2122/** @typedef {InheritanceItem[] } Inheritance */
2223
23- /** @typedef {NormalModuleCreateData & { cssLayer: CssLayer, supports: Supports, media: Media, inheritance?: Inheritance } } CSSModuleCreateData */
24+ /** @typedef {NormalModuleCreateData & { cssLayer: CssLayer, supports: Supports, media: Media, inheritance?: Inheritance, exportType?: CssParserExportType } } CSSModuleCreateData */
2425
2526class CssModule extends NormalModule {
2627 /**
@@ -38,6 +39,8 @@ class CssModule extends NormalModule {
3839 this . media = options . media ;
3940 /** @type {CSSModuleCreateData['inheritance'] } */
4041 this . inheritance = options . inheritance ;
42+ /** @type {CSSModuleCreateData['exportType'] } */
43+ this . exportType = options . exportType ;
4144 }
4245
4346 /**
@@ -69,6 +72,10 @@ class CssModule extends NormalModule {
6972 identifier += `|${ inheritance . join ( "|" ) } ` ;
7073 }
7174
75+ if ( this . exportType ) {
76+ identifier += `|${ this . exportType } ` ;
77+ }
78+
7279 // We generate extra code for HMR, so we need to invalidate the module
7380 if ( this . hot ) {
7481 identifier += `|${ this . hot } ` ;
@@ -98,6 +105,10 @@ class CssModule extends NormalModule {
98105 identifier += ` (media: ${ this . media } )` ;
99106 }
100107
108+ if ( this . exportType ) {
109+ identifier += ` (exportType: ${ this . exportType } )` ;
110+ }
111+
101112 return identifier ;
102113 }
103114
@@ -115,6 +126,7 @@ class CssModule extends NormalModule {
115126 this . supports = m . supports ;
116127 this . media = m . media ;
117128 this . inheritance = m . inheritance ;
129+ this . exportType = m . exportType ;
118130 }
119131
120132 /**
@@ -126,6 +138,7 @@ class CssModule extends NormalModule {
126138 write ( this . supports ) ;
127139 write ( this . media ) ;
128140 write ( this . inheritance ) ;
141+ write ( this . exportType ) ;
129142 super . serialize ( context ) ;
130143 }
131144
@@ -155,7 +168,8 @@ class CssModule extends NormalModule {
155168 supports : /** @type {EXPECTED_ANY } */ ( null ) ,
156169 media : /** @type {EXPECTED_ANY } */ ( null ) ,
157170 inheritance : /** @type {EXPECTED_ANY } */ ( null ) ,
158- extractSourceMap : /** @type {EXPECTED_ANY } */ ( null )
171+ extractSourceMap : /** @type {EXPECTED_ANY } */ ( null ) ,
172+ exportType : /** @type {EXPECTED_ANY } */ ( null )
159173 } ) ;
160174 obj . deserialize ( context ) ;
161175 return obj ;
@@ -170,6 +184,7 @@ class CssModule extends NormalModule {
170184 this . supports = read ( ) ;
171185 this . media = read ( ) ;
172186 this . inheritance = read ( ) ;
187+ this . exportType = read ( ) ;
173188 super . deserialize ( context ) ;
174189 }
175190}
0 commit comments