webpack 5.106.2 → 5.107.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/README.md +2 -2
  2. package/lib/APIPlugin.js +1 -1
  3. package/lib/Cache.js +3 -6
  4. package/lib/CompatibilityPlugin.js +8 -7
  5. package/lib/Compilation.js +34 -26
  6. package/lib/Compiler.js +4 -13
  7. package/lib/ContextModule.js +2 -2
  8. package/lib/DefinePlugin.js +2 -2
  9. package/lib/Dependency.js +22 -1
  10. package/lib/DependencyTemplate.js +2 -1
  11. package/lib/EnvironmentPlugin.js +1 -1
  12. package/lib/EvalSourceMapDevToolPlugin.js +8 -9
  13. package/lib/ExternalModule.js +76 -15
  14. package/lib/ExternalModuleFactoryPlugin.js +5 -0
  15. package/lib/FileSystemInfo.js +187 -72
  16. package/lib/Generator.js +3 -3
  17. package/lib/HotModuleReplacementPlugin.js +26 -8
  18. package/lib/IgnorePlugin.js +2 -1
  19. package/lib/Module.js +19 -18
  20. package/lib/ModuleFactory.js +1 -1
  21. package/lib/ModuleSourceTypeConstants.js +31 -1
  22. package/lib/ModuleTypeConstants.js +12 -3
  23. package/lib/MultiCompiler.js +2 -2
  24. package/lib/NodeStuffPlugin.js +1 -1
  25. package/lib/NormalModule.js +13 -31
  26. package/lib/NormalModuleFactory.js +10 -2
  27. package/lib/Parser.js +1 -1
  28. package/lib/ProgressPlugin.js +129 -56
  29. package/lib/RuntimeGlobals.js +5 -5
  30. package/lib/RuntimeModule.js +9 -7
  31. package/lib/RuntimePlugin.js +11 -0
  32. package/lib/WarnCaseSensitiveModulesPlugin.js +70 -2
  33. package/lib/WarnDeprecatedOptionPlugin.js +1 -1
  34. package/lib/WarnNoModeSetPlugin.js +16 -1
  35. package/lib/Watching.js +2 -3
  36. package/lib/WebpackError.js +3 -77
  37. package/lib/WebpackIsIncludedPlugin.js +1 -1
  38. package/lib/WebpackOptionsApply.js +13 -1
  39. package/lib/asset/AssetBytesGenerator.js +6 -2
  40. package/lib/asset/AssetGenerator.js +22 -8
  41. package/lib/asset/AssetModulesPlugin.js +3 -1
  42. package/lib/asset/AssetSourceGenerator.js +6 -2
  43. package/lib/buildChunkGraph.js +4 -6
  44. package/lib/cache/PackFileCacheStrategy.js +4 -4
  45. package/lib/cli.js +3 -1
  46. package/lib/config/defaults.js +197 -10
  47. package/lib/config/normalization.js +3 -1
  48. package/lib/css/CssGenerator.js +320 -105
  49. package/lib/css/CssInjectStyleRuntimeModule.js +44 -42
  50. package/lib/css/CssLoadingRuntimeModule.js +22 -4
  51. package/lib/{CssModule.js → css/CssModule.js} +15 -15
  52. package/lib/css/CssModulesPlugin.js +166 -86
  53. package/lib/css/CssParser.js +566 -269
  54. package/lib/css/walkCssTokens.js +148 -2
  55. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +1 -1
  56. package/lib/dependencies/CommonJsDependencyHelpers.js +63 -0
  57. package/lib/dependencies/CommonJsExportRequireDependency.js +54 -10
  58. package/lib/dependencies/CommonJsExportsParserPlugin.js +1 -1
  59. package/lib/dependencies/CommonJsFullRequireDependency.js +32 -9
  60. package/lib/dependencies/CommonJsImportsParserPlugin.js +4 -3
  61. package/lib/dependencies/CommonJsRequireDependency.js +67 -4
  62. package/lib/dependencies/ContextDependency.js +1 -1
  63. package/lib/dependencies/ContextDependencyHelpers.js +1 -1
  64. package/lib/dependencies/CreateRequireParserPlugin.js +1 -1
  65. package/lib/dependencies/CriticalDependencyWarning.js +1 -1
  66. package/lib/dependencies/CssIcssExportDependency.js +332 -67
  67. package/lib/dependencies/CssIcssImportDependency.js +49 -7
  68. package/lib/dependencies/CssIcssSymbolDependency.js +11 -3
  69. package/lib/dependencies/CssImportDependency.js +8 -0
  70. package/lib/dependencies/CssUrlDependency.js +25 -0
  71. package/lib/dependencies/HarmonyDetectionParserPlugin.js +1 -1
  72. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +8 -7
  73. package/lib/dependencies/HarmonyExportExpressionDependency.js +22 -14
  74. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +110 -3
  75. package/lib/dependencies/HarmonyImportDependency.js +10 -2
  76. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +22 -1
  77. package/lib/dependencies/HarmonyImportSpecifierDependency.js +1 -1
  78. package/lib/{HarmonyLinkingError.js → dependencies/HarmonyLinkingError.js} +5 -3
  79. package/lib/dependencies/HtmlInlineScriptDependency.js +133 -0
  80. package/lib/dependencies/HtmlInlineStyleDependency.js +101 -0
  81. package/lib/dependencies/HtmlScriptSrcDependency.js +318 -0
  82. package/lib/dependencies/HtmlSourceDependency.js +127 -0
  83. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -1
  84. package/lib/dependencies/ImportParserPlugin.js +2 -2
  85. package/lib/dependencies/ImportPhase.js +1 -1
  86. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +1 -1
  87. package/lib/{RequireJsStuffPlugin.js → dependencies/RequireJsStuffPlugin.js} +7 -7
  88. package/lib/dependencies/SystemPlugin.js +1 -1
  89. package/lib/dependencies/WebAssemblyImportDependency.js +1 -1
  90. package/lib/dependencies/WorkerPlugin.js +2 -2
  91. package/lib/{DelegatedModule.js → dll/DelegatedModule.js} +31 -31
  92. package/lib/{DelegatedModuleFactoryPlugin.js → dll/DelegatedModuleFactoryPlugin.js} +4 -4
  93. package/lib/{DelegatedPlugin.js → dll/DelegatedPlugin.js} +2 -2
  94. package/lib/{DllEntryPlugin.js → dll/DllEntryPlugin.js} +4 -4
  95. package/lib/{DllModule.js → dll/DllModule.js} +24 -24
  96. package/lib/{DllModuleFactory.js → dll/DllModuleFactory.js} +4 -4
  97. package/lib/{DllPlugin.js → dll/DllPlugin.js} +6 -5
  98. package/lib/{DllReferencePlugin.js → dll/DllReferencePlugin.js} +14 -14
  99. package/lib/{LibManifestPlugin.js → dll/LibManifestPlugin.js} +9 -9
  100. package/lib/{AsyncDependencyToInitialChunkError.js → errors/AsyncDependencyToInitialChunkError.js} +2 -2
  101. package/lib/errors/BuildCycleError.js +1 -1
  102. package/lib/{ChunkRenderError.js → errors/ChunkRenderError.js} +1 -1
  103. package/lib/{CodeGenerationError.js → errors/CodeGenerationError.js} +1 -1
  104. package/lib/{CommentCompilationWarning.js → errors/CommentCompilationWarning.js} +3 -3
  105. package/lib/{ConcurrentCompilationError.js → errors/ConcurrentCompilationError.js} +4 -2
  106. package/lib/{EnvironmentNotSupportAsyncWarning.js → errors/EnvironmentNotSupportAsyncWarning.js} +4 -4
  107. package/lib/{HookWebpackError.js → errors/HookWebpackError.js} +5 -5
  108. package/lib/{IgnoreErrorModuleFactory.js → errors/IgnoreErrorModuleFactory.js} +4 -4
  109. package/lib/{InvalidDependenciesModuleWarning.js → errors/InvalidDependenciesModuleWarning.js} +3 -3
  110. package/lib/errors/JSONParseError.js +114 -0
  111. package/lib/{ModuleBuildError.js → errors/ModuleBuildError.js} +5 -5
  112. package/lib/{ModuleDependencyError.js → errors/ModuleDependencyError.js} +2 -2
  113. package/lib/{ModuleDependencyWarning.js → errors/ModuleDependencyWarning.js} +4 -4
  114. package/lib/{ModuleError.js → errors/ModuleError.js} +5 -5
  115. package/lib/{ModuleHashingError.js → errors/ModuleHashingError.js} +1 -1
  116. package/lib/{ModuleNotFoundError.js → errors/ModuleNotFoundError.js} +2 -2
  117. package/lib/{ModuleParseError.js → errors/ModuleParseError.js} +8 -6
  118. package/lib/{ModuleRestoreError.js → errors/ModuleRestoreError.js} +1 -1
  119. package/lib/{ModuleStoreError.js → errors/ModuleStoreError.js} +1 -1
  120. package/lib/{ModuleWarning.js → errors/ModuleWarning.js} +5 -5
  121. package/lib/{NodeStuffInWebError.js → errors/NodeStuffInWebError.js} +4 -4
  122. package/lib/errors/NonErrorEmittedError.js +28 -0
  123. package/lib/{UnhandledSchemeError.js → errors/UnhandledSchemeError.js} +2 -2
  124. package/lib/{UnsupportedFeatureWarning.js → errors/UnsupportedFeatureWarning.js} +3 -3
  125. package/lib/errors/WebpackError.js +84 -0
  126. package/lib/html/HtmlGenerator.js +379 -0
  127. package/lib/html/HtmlModulesPlugin.js +433 -0
  128. package/lib/html/HtmlParser.js +1489 -0
  129. package/lib/html/walkHtmlTokens.js +2733 -0
  130. package/lib/ids/IdHelpers.js +2 -1
  131. package/lib/index.js +34 -15
  132. package/lib/javascript/JavascriptModulesPlugin.js +89 -8
  133. package/lib/javascript/JavascriptParser.js +197 -16
  134. package/lib/javascript/JavascriptParserHelpers.js +1 -1
  135. package/lib/json/JsonParser.js +7 -16
  136. package/lib/library/AbstractLibraryPlugin.js +1 -1
  137. package/lib/library/EnableLibraryPlugin.js +1 -1
  138. package/lib/{FalseIIFEUmdWarning.js → library/FalseIIFEUmdWarning.js} +1 -1
  139. package/lib/library/ModuleLibraryPlugin.js +74 -0
  140. package/lib/node/NodeEnvironmentPlugin.js +4 -2
  141. package/lib/node/nodeConsole.js +113 -64
  142. package/lib/optimize/ConcatenatedModule.js +51 -6
  143. package/lib/optimize/InnerGraph.js +1 -1
  144. package/lib/optimize/InnerGraphPlugin.js +11 -1
  145. package/lib/optimize/MinMaxSizeWarning.js +4 -4
  146. package/lib/optimize/ModuleConcatenationPlugin.js +15 -7
  147. package/lib/optimize/RealContentHashPlugin.js +89 -26
  148. package/lib/optimize/SideEffectsFlagPlugin.js +111 -3
  149. package/lib/optimize/SplitChunksPlugin.js +1 -1
  150. package/lib/performance/AssetsOverSizeLimitWarning.js +2 -2
  151. package/lib/performance/EntrypointsOverSizeLimitWarning.js +2 -2
  152. package/lib/performance/NoAsyncChunksWarning.js +5 -3
  153. package/lib/performance/SizeLimitsPlugin.js +1 -1
  154. package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -1
  155. package/lib/rules/UseEffectRulePlugin.js +4 -3
  156. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +119 -13
  157. package/lib/runtime/SetAnonymousDefaultNameRuntimeModule.js +35 -0
  158. package/lib/schemes/DataUriPlugin.js +13 -1
  159. package/lib/schemes/VirtualUrlPlugin.js +1 -1
  160. package/lib/serialization/SerializerMiddleware.js +2 -2
  161. package/lib/sharing/ConsumeSharedPlugin.js +2 -2
  162. package/lib/sharing/ConsumeSharedRuntimeModule.js +8 -4
  163. package/lib/sharing/ProvideSharedModule.js +1 -1
  164. package/lib/sharing/ProvideSharedPlugin.js +1 -1
  165. package/lib/sharing/resolveMatchedConfigs.js +1 -1
  166. package/lib/stats/DefaultStatsFactoryPlugin.js +2 -2
  167. package/lib/stats/DefaultStatsPresetPlugin.js +1 -1
  168. package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
  169. package/lib/stats/StatsFactory.js +1 -1
  170. package/lib/typescript/TypeScriptPlugin.js +210 -0
  171. package/lib/url/URLParserPlugin.js +2 -2
  172. package/lib/util/AsyncQueue.js +2 -2
  173. package/lib/util/Hash.js +2 -2
  174. package/lib/util/LocConverter.js +53 -0
  175. package/lib/util/SortableSet.js +1 -1
  176. package/lib/util/cleverMerge.js +2 -2
  177. package/lib/util/comparators.js +3 -3
  178. package/lib/util/concatenate.js +3 -3
  179. package/lib/util/conventions.js +42 -1
  180. package/lib/util/createMappings.js +118 -0
  181. package/lib/{formatLocation.js → util/formatLocation.js} +2 -2
  182. package/lib/{SizeFormatHelpers.js → util/formatSize.js} +3 -1
  183. package/lib/util/fs.js +8 -8
  184. package/lib/util/hash/md4.js +1 -1
  185. package/lib/util/hash/xxhash64.js +1 -1
  186. package/lib/util/identifier.js +48 -0
  187. package/lib/util/internalSerializables.js +35 -19
  188. package/lib/util/magicComment.js +10 -7
  189. package/lib/util/parseJson.js +2 -73
  190. package/lib/util/source.js +21 -0
  191. package/lib/util/topologicalSort.js +69 -0
  192. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +2 -2
  193. package/lib/wasm-async/AsyncWebAssemblyParser.js +1 -1
  194. package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +5 -3
  195. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +1 -1
  196. package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +5 -3
  197. package/lib/webpack.js +3 -1
  198. package/package.json +22 -20
  199. package/schemas/WebpackOptions.check.js +1 -1
  200. package/schemas/WebpackOptions.json +118 -3
  201. package/schemas/plugins/{DllPlugin.check.d.ts → HtmlGeneratorOptions.check.d.ts} +1 -1
  202. package/schemas/plugins/HtmlGeneratorOptions.check.js +6 -0
  203. package/schemas/plugins/HtmlGeneratorOptions.json +3 -0
  204. package/schemas/plugins/ProgressPlugin.check.js +1 -1
  205. package/schemas/plugins/ProgressPlugin.json +22 -0
  206. package/schemas/plugins/{DllReferencePlugin.check.d.ts → css/CssAutoOrModuleParserOptions.check.d.ts} +1 -1
  207. package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.js +6 -0
  208. package/schemas/plugins/css/CssAutoOrModuleParserOptions.json +3 -0
  209. package/schemas/plugins/dll/DllPlugin.check.d.ts +7 -0
  210. package/schemas/plugins/dll/DllReferencePlugin.check.d.ts +7 -0
  211. package/types.d.ts +810 -101
  212. package/lib/CaseSensitiveModulesWarning.js +0 -80
  213. package/lib/GraphHelpers.js +0 -49
  214. package/lib/NoModeWarning.js +0 -23
  215. package/lib/css/CssMergeStyleSheetsRuntimeModule.js +0 -57
  216. /package/lib/{AbstractMethodError.js → errors/AbstractMethodError.js} +0 -0
  217. /package/schemas/plugins/{DllPlugin.check.js → dll/DllPlugin.check.js} +0 -0
  218. /package/schemas/plugins/{DllPlugin.json → dll/DllPlugin.json} +0 -0
  219. /package/schemas/plugins/{DllReferencePlugin.check.js → dll/DllReferencePlugin.check.js} +0 -0
  220. /package/schemas/plugins/{DllReferencePlugin.json → dll/DllReferencePlugin.json} +0 -0
@@ -70,14 +70,25 @@ class CssInjectStyleRuntimeModule extends RuntimeModule {
70
70
  const { createStyle } =
71
71
  CssInjectStyleRuntimeModule.getCompilationHooks(compilation);
72
72
 
73
+ // Only emit the nonce check when scriptNonce is part of the runtime
74
+ // requirements. Otherwise referencing `__webpack_require__.nc` would
75
+ // keep the require runtime alive for nothing.
76
+ const withScriptNonce =
77
+ _runtimeRequirements &&
78
+ _runtimeRequirements.has(RuntimeGlobals.scriptNonce);
79
+
73
80
  const createStyleElementCode = Template.asString([
74
81
  "var style = document.createElement('style');",
75
82
  "",
76
- `if (${RuntimeGlobals.scriptNonce}) {`,
77
- Template.indent(
78
- `style.setAttribute("nonce", ${RuntimeGlobals.scriptNonce});`
79
- ),
80
- "}",
83
+ ...(withScriptNonce
84
+ ? [
85
+ `if (${RuntimeGlobals.scriptNonce}) {`,
86
+ Template.indent(
87
+ `style.setAttribute("nonce", ${RuntimeGlobals.scriptNonce});`
88
+ ),
89
+ "}"
90
+ ]
91
+ : []),
81
92
  'style.setAttribute("data-webpack", getDataWebpackId(key));'
82
93
  ]);
83
94
 
@@ -88,18 +99,6 @@ class CssInjectStyleRuntimeModule extends RuntimeModule {
88
99
  Template.indent("return dataWebpackPrefix + identifier;"),
89
100
  "}",
90
101
  "",
91
- "function applyStyle(styleElement, css) {",
92
- Template.indent("styleElement.textContent = css;"),
93
- "}",
94
- "",
95
- "function removeStyleElement(styleElement) {",
96
- Template.indent([
97
- "if (styleElement.parentNode) {",
98
- Template.indent("styleElement.parentNode.removeChild(styleElement);"),
99
- "}"
100
- ]),
101
- "}",
102
- "",
103
102
  "function findStyleElement(identifier) {",
104
103
  Template.indent([
105
104
  "var elements = document.getElementsByTagName('style');",
@@ -131,36 +130,39 @@ class CssInjectStyleRuntimeModule extends RuntimeModule {
131
130
  `${RuntimeGlobals.cssInjectStyle} = ${runtimeTemplate.basicFunction(
132
131
  "identifier, css",
133
132
  [
134
- "var element = findStyleElement(identifier);",
135
- "if (element) {",
136
- Template.indent("applyStyle(element, css);"),
137
- "} else {",
138
- Template.indent([
139
- "var element = insertStyleElement(identifier);",
140
- "applyStyle(element, css);"
141
- ]),
142
- "}"
133
+ "var element = findStyleElement(identifier) || insertStyleElement(identifier);",
134
+ "element.textContent = css;"
143
135
  ]
144
136
  )};`,
145
137
  "",
146
- `${RuntimeGlobals.cssInjectStyle}.removeModules = ${runtimeTemplate.basicFunction(
147
- "removedModules",
148
- [
149
- "if (!removedModules) return;",
150
- "var identifiers = Array.isArray(removedModules) ? removedModules : [removedModules];",
151
- "for (var i = 0; i < identifiers.length; i++) {",
152
- Template.indent([
153
- "var identifier = identifiers[i];",
154
- "var element = findStyleElement(identifier);",
155
- "if (element) {",
156
- Template.indent("removeStyleElement(element);"),
157
- "}"
158
- ]),
159
- "}"
160
- ]
161
- )};`,
162
138
  withHmr
163
139
  ? Template.asString([
140
+ "",
141
+ "function removeStyleElement(styleElement) {",
142
+ Template.indent([
143
+ "if (styleElement.parentNode) {",
144
+ Template.indent(
145
+ "styleElement.parentNode.removeChild(styleElement);"
146
+ ),
147
+ "}"
148
+ ]),
149
+ "}",
150
+ `${RuntimeGlobals.cssInjectStyle}.removeModules = ${runtimeTemplate.basicFunction(
151
+ "removedModules",
152
+ [
153
+ "if (!removedModules) return;",
154
+ "var identifiers = Array.isArray(removedModules) ? removedModules : [removedModules];",
155
+ "for (var i = 0; i < identifiers.length; i++) {",
156
+ Template.indent([
157
+ "var identifier = identifiers[i];",
158
+ "var element = findStyleElement(identifier);",
159
+ "if (element) {",
160
+ Template.indent("removeStyleElement(element);"),
161
+ "}"
162
+ ]),
163
+ "}"
164
+ ]
165
+ )};`,
164
166
  `${RuntimeGlobals.hmrDownloadUpdateHandlers}.cssInjectStyle = ${runtimeTemplate.basicFunction(
165
167
  "chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList, css",
166
168
  [
@@ -24,6 +24,7 @@ const { chunkHasCss } = require("./CssModulesPlugin");
24
24
  * @property {SyncWaterfallHook<[string, Chunk]>} createStylesheet
25
25
  * @property {SyncWaterfallHook<[string, Chunk]>} linkPreload
26
26
  * @property {SyncWaterfallHook<[string, Chunk]>} linkPrefetch
27
+ * @property {SyncWaterfallHook<[string, Chunk]>} linkInsert
27
28
  */
28
29
 
29
30
  /** @type {WeakMap<Compilation, CssLoadingRuntimeModulePluginHooks>} */
@@ -45,7 +46,8 @@ class CssLoadingRuntimeModule extends RuntimeModule {
45
46
  hooks = {
46
47
  createStylesheet: new SyncWaterfallHook(["source", "chunk"]),
47
48
  linkPreload: new SyncWaterfallHook(["source", "chunk"]),
48
- linkPrefetch: new SyncWaterfallHook(["source", "chunk"])
49
+ linkPrefetch: new SyncWaterfallHook(["source", "chunk"]),
50
+ linkInsert: new SyncWaterfallHook(["source", "chunk"])
49
51
  };
50
52
  compilationHooksMap.set(compilation, hooks);
51
53
  }
@@ -122,7 +124,7 @@ class CssLoadingRuntimeModule extends RuntimeModule {
122
124
  (environment.document || isNeutralPlatform) &&
123
125
  chunk.hasChildByOrder(chunkGraph, "preload", true, chunkHasCss);
124
126
 
125
- const { linkPreload, linkPrefetch, createStylesheet } =
127
+ const { linkPreload, linkPrefetch, createStylesheet, linkInsert } =
126
128
  CssLoadingRuntimeModule.getCompilationHooks(compilation);
127
129
 
128
130
  const withFetchPriority = _runtimeRequirements.has(
@@ -242,8 +244,24 @@ class CssLoadingRuntimeModule extends RuntimeModule {
242
244
  withHmr && withFetchPriority
243
245
  ? 'if (hmr && hmr.getAttribute("fetchpriority")) link.setAttribute("fetchpriority", hmr.getAttribute("fetchpriority"));'
244
246
  : "",
245
- withHmr ? "hmr ? document.head.insertBefore(link, hmr) :" : "",
246
- "needAttach && document.head.appendChild(link);",
247
+ linkInsert.call(
248
+ withHmr
249
+ ? Template.asString([
250
+ "if (hmr) {",
251
+ Template.indent(
252
+ "hmr.parentNode.insertBefore(link, hmr);"
253
+ ),
254
+ "} else if (needAttach) {",
255
+ Template.indent("document.head.appendChild(link);"),
256
+ "}"
257
+ ])
258
+ : Template.asString([
259
+ "if (needAttach) {",
260
+ Template.indent("document.head.appendChild(link);"),
261
+ "}"
262
+ ]),
263
+ /** @type {Chunk} */ (this.chunk)
264
+ ),
247
265
  "return link;"
248
266
  ]
249
267
  )};`
@@ -5,15 +5,15 @@
5
5
 
6
6
  "use strict";
7
7
 
8
- const NormalModule = require("./NormalModule");
9
- const makeSerializable = require("./util/makeSerializable");
8
+ const NormalModule = require("../NormalModule");
9
+ const makeSerializable = require("../util/makeSerializable");
10
10
 
11
- /** @typedef {import("./Module")} Module */
12
- /** @typedef {import("./NormalModule").NormalModuleCreateData} NormalModuleCreateData */
13
- /** @typedef {import("./RequestShortener")} RequestShortener */
14
- /** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
15
- /** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
16
- /** @typedef {import("../declarations/WebpackOptions").CssParserExportType} CssParserExportType */
11
+ /** @typedef {import("../Module")} Module */
12
+ /** @typedef {import("../NormalModule").NormalModuleCreateData} NormalModuleCreateData */
13
+ /** @typedef {import("../RequestShortener")} RequestShortener */
14
+ /** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
15
+ /** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
16
+ /** @typedef {import("../../declarations/WebpackOptions").CssParserExportType} CssParserExportType */
17
17
 
18
18
  /** @typedef {string | undefined} CssLayer */
19
19
  /** @typedef {string | undefined} Supports */
@@ -21,26 +21,26 @@ const makeSerializable = require("./util/makeSerializable");
21
21
  /** @typedef {[CssLayer, Supports, Media]} InheritanceItem */
22
22
  /** @typedef {InheritanceItem[]} Inheritance */
23
23
 
24
- /** @typedef {NormalModuleCreateData & { cssLayer: CssLayer, supports: Supports, media: Media, inheritance?: Inheritance, exportType?: CssParserExportType }} CSSModuleCreateData */
24
+ /** @typedef {NormalModuleCreateData & { cssLayer: CssLayer, supports: Supports, media: Media, inheritance?: Inheritance, exportType?: CssParserExportType }} CssModuleCreateData */
25
25
 
26
26
  class CssModule extends NormalModule {
27
27
  /**
28
28
  * Creates an instance of CssModule.
29
- * @param {CSSModuleCreateData} options options object
29
+ * @param {CssModuleCreateData} options options object
30
30
  */
31
31
  constructor(options) {
32
32
  super(options);
33
33
 
34
34
  // Avoid override `layer` for `Module` class, because it is a feature to run module in specific layer
35
- /** @type {CSSModuleCreateData['cssLayer']} */
35
+ /** @type {CssModuleCreateData['cssLayer']} */
36
36
  this.cssLayer = options.cssLayer;
37
- /** @type {CSSModuleCreateData['supports']} */
37
+ /** @type {CssModuleCreateData['supports']} */
38
38
  this.supports = options.supports;
39
- /** @type {CSSModuleCreateData['media']} */
39
+ /** @type {CssModuleCreateData['media']} */
40
40
  this.media = options.media;
41
- /** @type {CSSModuleCreateData['inheritance']} */
41
+ /** @type {CssModuleCreateData['inheritance']} */
42
42
  this.inheritance = options.inheritance;
43
- /** @type {CSSModuleCreateData['exportType']} */
43
+ /** @type {CssModuleCreateData['exportType']} */
44
44
  this.exportType = options.exportType;
45
45
  }
46
46