@rspack/core 1.0.10 → 1.0.11

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 (217) hide show
  1. package/dist/builtin-plugin/css-extract/utils.d.ts +1 -0
  2. package/dist/config/types.d.ts +309 -0
  3. package/dist/config/zod.d.ts +22 -534
  4. package/dist/cssExtractHmr.js +224 -0
  5. package/dist/cssExtractLoader.js +277 -0
  6. package/dist/index.js +23347 -31
  7. package/dist/{builtin-plugin/css-extract/hmr/hotModuleReplacement.d.ts → runtime/cssExtractHmr.d.ts} +1 -0
  8. package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
  9. package/dist/stats/statsFactoryUtils.d.ts +1 -0
  10. package/package.json +8 -5
  11. package/compiled/json-parse-even-better-errors/index.d.ts +0 -1
  12. package/compiled/json-parse-even-better-errors/index.js +0 -193
  13. package/compiled/json-parse-even-better-errors/package.json +0 -1
  14. package/compiled/neo-async/index.d.ts +0 -685
  15. package/compiled/neo-async/index.js +0 -9207
  16. package/compiled/neo-async/license +0 -22
  17. package/compiled/neo-async/package.json +0 -1
  18. package/compiled/zod-validation-error/index.d.ts +0 -41
  19. package/compiled/zod-validation-error/index.js +0 -335
  20. package/compiled/zod-validation-error/license +0 -9
  21. package/compiled/zod-validation-error/package.json +0 -1
  22. package/dist/Chunk.js +0 -118
  23. package/dist/ChunkGraph.js +0 -27
  24. package/dist/ChunkGroup.js +0 -76
  25. package/dist/Compilation.js +0 -854
  26. package/dist/Compiler.js +0 -925
  27. package/dist/ContextModuleFactory.js +0 -36
  28. package/dist/DependenciesBlock.js +0 -30
  29. package/dist/Dependency.js +0 -43
  30. package/dist/Entrypoint.js +0 -21
  31. package/dist/ErrorHelpers.js +0 -62
  32. package/dist/ExecuteModulePlugin.js +0 -46
  33. package/dist/FileSystem.js +0 -34
  34. package/dist/FileSystemInfo.js +0 -2
  35. package/dist/Module.js +0 -226
  36. package/dist/ModuleTypeConstants.js +0 -92
  37. package/dist/MultiCompiler.js +0 -440
  38. package/dist/MultiStats.js +0 -161
  39. package/dist/MultiWatching.js +0 -62
  40. package/dist/NormalModule.js +0 -97
  41. package/dist/NormalModuleFactory.js +0 -43
  42. package/dist/Resolver.js +0 -39
  43. package/dist/ResolverFactory.js +0 -61
  44. package/dist/RspackError.js +0 -21
  45. package/dist/RuleSetCompiler.js +0 -10
  46. package/dist/RuntimeGlobals.js +0 -357
  47. package/dist/RuntimeModule.js +0 -58
  48. package/dist/Stats.js +0 -161
  49. package/dist/Template.js +0 -206
  50. package/dist/Watching.js +0 -290
  51. package/dist/builtin-loader/index.js +0 -17
  52. package/dist/builtin-loader/lightningcss/index.js +0 -175
  53. package/dist/builtin-loader/swc/index.js +0 -5
  54. package/dist/builtin-loader/swc/pluginImport.js +0 -35
  55. package/dist/builtin-loader/swc/react.js +0 -7
  56. package/dist/builtin-loader/swc/types.js +0 -2
  57. package/dist/builtin-plugin/APIPlugin.js +0 -6
  58. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.js +0 -6
  59. package/dist/builtin-plugin/AssetModulesPlugin.js +0 -6
  60. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.js +0 -6
  61. package/dist/builtin-plugin/BannerPlugin.js +0 -22
  62. package/dist/builtin-plugin/BundlerInfoRspackPlugin.js +0 -12
  63. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.js +0 -6
  64. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.js +0 -6
  65. package/dist/builtin-plugin/ContextReplacementPlugin.js +0 -43
  66. package/dist/builtin-plugin/CopyRspackPlugin.js +0 -21
  67. package/dist/builtin-plugin/CssModulesPlugin.js +0 -6
  68. package/dist/builtin-plugin/DataUriPlugin.js +0 -6
  69. package/dist/builtin-plugin/DefinePlugin.js +0 -44
  70. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.js +0 -6
  71. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.js +0 -6
  72. package/dist/builtin-plugin/DynamicEntryPlugin.js +0 -36
  73. package/dist/builtin-plugin/ElectronTargetPlugin.js +0 -6
  74. package/dist/builtin-plugin/EnableChunkLoadingPlugin.js +0 -6
  75. package/dist/builtin-plugin/EnableLibraryPlugin.js +0 -39
  76. package/dist/builtin-plugin/EnableWasmLoadingPlugin.js +0 -6
  77. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.js +0 -6
  78. package/dist/builtin-plugin/EntryPlugin.js +0 -34
  79. package/dist/builtin-plugin/EvalDevToolModulePlugin.js +0 -6
  80. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.js +0 -16
  81. package/dist/builtin-plugin/ExternalsPlugin.js +0 -51
  82. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.js +0 -6
  83. package/dist/builtin-plugin/FileUriPlugin.js +0 -6
  84. package/dist/builtin-plugin/FlagDependencyExportsPlugin.js +0 -6
  85. package/dist/builtin-plugin/FlagDependencyUsagePlugin.js +0 -6
  86. package/dist/builtin-plugin/HotModuleReplacementPlugin.js +0 -18
  87. package/dist/builtin-plugin/HtmlRspackPlugin.js +0 -285
  88. package/dist/builtin-plugin/HttpExternalsRspackPlugin.js +0 -11
  89. package/dist/builtin-plugin/IgnorePlugin.js +0 -20
  90. package/dist/builtin-plugin/InferAsyncModulesPlugin.js +0 -6
  91. package/dist/builtin-plugin/JavascriptModulesPlugin.js +0 -55
  92. package/dist/builtin-plugin/JsLoaderRspackPlugin.js +0 -9
  93. package/dist/builtin-plugin/JsonModulesPlugin.js +0 -6
  94. package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +0 -30
  95. package/dist/builtin-plugin/LimitChunkCountPlugin.js +0 -8
  96. package/dist/builtin-plugin/MangleExportsPlugin.js +0 -6
  97. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.js +0 -6
  98. package/dist/builtin-plugin/ModuleChunkFormatPlugin.js +0 -6
  99. package/dist/builtin-plugin/ModuleConcatenationPlugin.js +0 -6
  100. package/dist/builtin-plugin/NamedChunkIdsPlugin.js +0 -6
  101. package/dist/builtin-plugin/NamedModuleIdsPlugin.js +0 -6
  102. package/dist/builtin-plugin/NaturalChunkIdsPlugin.js +0 -6
  103. package/dist/builtin-plugin/NaturalModuleIdsPlugin.js +0 -6
  104. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.js +0 -6
  105. package/dist/builtin-plugin/NodeTargetPlugin.js +0 -6
  106. package/dist/builtin-plugin/ProgressPlugin.js +0 -15
  107. package/dist/builtin-plugin/ProvidePlugin.js +0 -14
  108. package/dist/builtin-plugin/RealContentHashPlugin.js +0 -6
  109. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.js +0 -6
  110. package/dist/builtin-plugin/RuntimeChunkPlugin.js +0 -6
  111. package/dist/builtin-plugin/RuntimePlugin.js +0 -6
  112. package/dist/builtin-plugin/SideEffectsFlagPlugin.js +0 -6
  113. package/dist/builtin-plugin/SizeLimitsPlugin.js +0 -9
  114. package/dist/builtin-plugin/SourceMapDevToolPlugin.js +0 -14
  115. package/dist/builtin-plugin/SplitChunksPlugin.js +0 -92
  116. package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +0 -80
  117. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.js +0 -6
  118. package/dist/builtin-plugin/WebWorkerTemplatePlugin.js +0 -6
  119. package/dist/builtin-plugin/WorkerPlugin.js +0 -31
  120. package/dist/builtin-plugin/base.js +0 -58
  121. package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +0 -182
  122. package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +0 -2
  123. package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.js +0 -31
  124. package/dist/builtin-plugin/css-extract/index.js +0 -105
  125. package/dist/builtin-plugin/css-extract/loader.js +0 -204
  126. package/dist/builtin-plugin/css-extract/utils.js +0 -51
  127. package/dist/builtin-plugin/index.js +0 -84
  128. package/dist/builtin-plugin/lazy-compilation/backend.js +0 -139
  129. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.js +0 -6
  130. package/dist/builtin-plugin/lazy-compilation/plugin.js +0 -60
  131. package/dist/config/adapter.js +0 -691
  132. package/dist/config/adapterRuleUse.js +0 -107
  133. package/dist/config/browserslistTargetHandler.js +0 -345
  134. package/dist/config/defaults.js +0 -876
  135. package/dist/config/index.js +0 -20
  136. package/dist/config/normalization.js +0 -299
  137. package/dist/config/target.js +0 -318
  138. package/dist/config/types.js +0 -3
  139. package/dist/config/zod.js +0 -1030
  140. package/dist/container/ContainerPlugin.js +0 -50
  141. package/dist/container/ContainerReferencePlugin.js +0 -49
  142. package/dist/container/ModuleFederationPlugin.js +0 -137
  143. package/dist/container/ModuleFederationPluginV1.js +0 -63
  144. package/dist/container/ModuleFederationRuntimePlugin.js +0 -6
  145. package/dist/container/options.js +0 -48
  146. package/dist/error/ConcurrentCompilationError.js +0 -20
  147. package/dist/exports.js +0 -183
  148. package/dist/lib/AbstractMethodError.js +0 -51
  149. package/dist/lib/Cache.js +0 -111
  150. package/dist/lib/CacheFacade.js +0 -321
  151. package/dist/lib/Dependency.js +0 -11
  152. package/dist/lib/EntryOptionPlugin.js +0 -89
  153. package/dist/lib/EnvironmentPlugin.js +0 -57
  154. package/dist/lib/HookWebpackError.js +0 -83
  155. package/dist/lib/IgnoreWarningsPlugin.js +0 -35
  156. package/dist/lib/LoaderOptionsPlugin.js +0 -74
  157. package/dist/lib/LoaderTargetPlugin.js +0 -37
  158. package/dist/lib/ModuleFilenameHelpers.js +0 -83
  159. package/dist/lib/NormalModuleReplacementPlugin.js +0 -85
  160. package/dist/lib/WebpackError.js +0 -20
  161. package/dist/lib/cache/MemoryCachePlugin.js +0 -40
  162. package/dist/lib/cache/getLazyHashedEtag.js +0 -73
  163. package/dist/lib/cache/mergeEtags.js +0 -74
  164. package/dist/lib/formatLocation.js +0 -64
  165. package/dist/loader-runner/LoaderLoadingError.js +0 -19
  166. package/dist/loader-runner/index.js +0 -735
  167. package/dist/loader-runner/loadLoader.js +0 -64
  168. package/dist/logging/Logger.js +0 -143
  169. package/dist/logging/createConsoleLogger.js +0 -176
  170. package/dist/logging/runtime.js +0 -37
  171. package/dist/logging/truncateArgs.js +0 -81
  172. package/dist/node/NodeEnvironmentPlugin.js +0 -50
  173. package/dist/node/NodeTemplatePlugin.js +0 -26
  174. package/dist/node/NodeWatchFileSystem.js +0 -144
  175. package/dist/node/nodeConsole.js +0 -146
  176. package/dist/rspack.js +0 -123
  177. package/dist/rspackOptionsApply.js +0 -274
  178. package/dist/sharing/ConsumeSharedPlugin.js +0 -69
  179. package/dist/sharing/ProvideSharedPlugin.js +0 -50
  180. package/dist/sharing/SharePlugin.js +0 -66
  181. package/dist/sharing/ShareRuntimePlugin.js +0 -26
  182. package/dist/sharing/utils.js +0 -8
  183. package/dist/stats/DefaultStatsFactoryPlugin.js +0 -1173
  184. package/dist/stats/DefaultStatsPresetPlugin.js +0 -305
  185. package/dist/stats/DefaultStatsPrinterPlugin.js +0 -1069
  186. package/dist/stats/StatsFactory.js +0 -167
  187. package/dist/stats/StatsPrinter.js +0 -142
  188. package/dist/stats/statsFactoryUtils.js +0 -341
  189. package/dist/util/ArrayQueue.js +0 -108
  190. package/dist/util/AssetInfo.js +0 -39
  191. package/dist/util/IterableHelpers.js +0 -35
  192. package/dist/util/MergeCaller.js +0 -24
  193. package/dist/util/SizeFormatHelpers.js +0 -24
  194. package/dist/util/SplitChunkSize.js +0 -18
  195. package/dist/util/assertNotNil.js +0 -9
  196. package/dist/util/assetCondition.js +0 -2
  197. package/dist/util/bindingVersionCheck.js +0 -124
  198. package/dist/util/cleverMerge.js +0 -504
  199. package/dist/util/comparators.js +0 -108
  200. package/dist/util/createHash.js +0 -161
  201. package/dist/util/createReadonlyMap.js +0 -29
  202. package/dist/util/fake.js +0 -28
  203. package/dist/util/fs.js +0 -120
  204. package/dist/util/hash/BatchedHash.js +0 -69
  205. package/dist/util/hash/index.js +0 -39
  206. package/dist/util/hash/md4.js +0 -27
  207. package/dist/util/hash/wasm-hash.js +0 -167
  208. package/dist/util/hash/xxhash64.js +0 -27
  209. package/dist/util/identifier.js +0 -330
  210. package/dist/util/index.js +0 -123
  211. package/dist/util/memoize.js +0 -61
  212. package/dist/util/scheme.js +0 -57
  213. package/dist/util/smartGrouping.js +0 -148
  214. package/dist/util/source.js +0 -42
  215. package/dist/util/validate.js +0 -77
  216. package/dist/util/webpack.js +0 -27
  217. /package/dist/{container/default.runtime.js → moduleFederationDefaultRuntime.js} +0 -0
@@ -1,5 +1,6 @@
1
1
  import type { LoaderContext } from "../..";
2
2
  export declare function isAbsolutePath(str: string): boolean;
3
+ export declare const PLUGIN_NAME = "css-extract-rspack-plugin";
3
4
  export declare function isRelativePath(str: string): boolean;
4
5
  export declare function stringifyRequest(loaderContext: LoaderContext, request: string): string;
5
6
  export declare function stringifyLocal(value: any): any;
@@ -127,6 +127,315 @@ export type EntryStatic = EntryObject | EntryUnnamed;
127
127
  export type EntryDynamic = () => EntryStatic | Promise<EntryStatic>;
128
128
  /** The entry options for building */
129
129
  export type Entry = EntryStatic | EntryDynamic;
130
+ /** The output directory as an absolute path. */
131
+ export type Path = string;
132
+ /** Tells Rspack to include comments in bundles with information about the contained modules. */
133
+ export type Pathinfo = boolean | "verbose";
134
+ /** Before generating the products, delete all files in the output directory. */
135
+ export type AssetModuleFilename = Filename;
136
+ /** Specifies the filename of WebAssembly modules. */
137
+ export type WebassemblyModuleFilename = string;
138
+ /** This option determines the name of non-initial chunk files. */
139
+ export type ChunkFilename = Filename;
140
+ /** Allows you to set the [crossorigin attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) */
141
+ export type CrossOriginLoading = false | "anonymous" | "use-credentials";
142
+ /** This option determines the name of CSS output files on disk. */
143
+ export type CssFilename = Filename;
144
+ /** This option determines the name of non-initial CSS output files on disk. */
145
+ export type CssChunkFilename = Filename;
146
+ /** Customize the filenames of hot update chunks. */
147
+ export type HotUpdateChunkFilename = FilenameTemplate;
148
+ /** Customize the main hot update filename. */
149
+ export type HotUpdateMainFilename = FilenameTemplate;
150
+ /** Which uses JSONP for loading hot updates. */
151
+ export type HotUpdateGlobal = string;
152
+ /** A unique name of the Rspack build */
153
+ export type UniqueName = string;
154
+ /** The global variable is used by Rspack for loading chunks. */
155
+ export type ChunkLoadingGlobal = string;
156
+ /** List of library types enabled for use by entry points. */
157
+ export type EnabledLibraryTypes = string[];
158
+ /** Whether delete all files in the output directory. */
159
+ export type Clean = boolean;
160
+ /** Output JavaScript files as module type. */
161
+ export type OutputModule = boolean;
162
+ /** Tell Rspack to remove a module from the module instance cache (require.cache) if it throws an exception when it is required. */
163
+ export type StrictModuleExceptionHandling = boolean;
164
+ /** Handle error in module loading as per EcmaScript Modules spec at a performance cost. */
165
+ export type StrictModuleErrorHandling = boolean;
166
+ /** Indicates what global object will be used to mount the library. */
167
+ export type GlobalObject = string;
168
+ /** List of wasm loading types enabled for use by entry points. */
169
+ export type EnabledWasmLoadingTypes = string[];
170
+ /** The name of the native import() function. */
171
+ export type ImportFunctionName = string;
172
+ /** The name of the native import.meta object. */
173
+ export type ImportMetaName = string;
174
+ /** Tells Rspack to add IIFE wrapper around emitted code. */
175
+ export type Iife = boolean;
176
+ /** List of chunk loading types enabled for use by entry points. */
177
+ export type EnabledChunkLoadingTypes = string[];
178
+ /** The format of chunks */
179
+ export type ChunkFormat = string | false;
180
+ /** Set a public path for Worker. */
181
+ export type WorkerPublicPath = string;
182
+ /** Controls [Trusted Types](https://web.dev/articles/trusted-types) compatibility. */
183
+ export type TrustedTypes = {
184
+ policyName?: string;
185
+ };
186
+ /** The encoding to use when generating the hash. */
187
+ export type HashDigest = string;
188
+ /** The prefix length of the hash digest to use. */
189
+ export type HashDigestLength = number;
190
+ /** The hashing algorithm to use. */
191
+ export type HashFunction = "md4" | "xxhash64";
192
+ /** An optional salt to update the hash. */
193
+ export type HashSalt = string;
194
+ /** Configure how source maps are named. */
195
+ export type SourceMapFilename = string;
196
+ /** This option determines the module's namespace */
197
+ export type DevtoolNamespace = string;
198
+ /** This option is only used when devtool uses an option that requires module names. */
199
+ export type DevtoolModuleFilenameTemplate = string | ((info: any) => any);
200
+ /** A fallback is used when the template string or function above yields duplicates. */
201
+ export type DevtoolFallbackModuleFilenameTemplate = DevtoolModuleFilenameTemplate;
202
+ /** Tell Rspack what kind of ES-features may be used in the generated runtime-code. */
203
+ export type Environment = {
204
+ /** The environment supports arrow functions ('() => { ... }'). */
205
+ arrowFunction?: boolean;
206
+ /** The environment supports async function and await ('async function () { await ... }'). */
207
+ asyncFunction?: boolean;
208
+ /** The environment supports BigInt as literal (123n). */
209
+ bigIntLiteral?: boolean;
210
+ /** The environment supports const and let for variable declarations. */
211
+ const?: boolean;
212
+ /** The environment supports destructuring ('{ a, b } = obj'). */
213
+ destructuring?: boolean;
214
+ /** The environment supports 'document' variable. */
215
+ document?: boolean;
216
+ /** The environment supports an async import() function to import EcmaScript modules. */
217
+ dynamicImport?: boolean;
218
+ /** The environment supports an async import() when creating a worker, only for web targets at the moment. */
219
+ dynamicImportInWorker?: boolean;
220
+ /** The environment supports 'for of' iteration ('for (const x of array) { ... }'). */
221
+ forOf?: boolean;
222
+ /** The environment supports 'globalThis'. */
223
+ globalThis?: boolean;
224
+ /** The environment supports ECMAScript Module syntax to import ECMAScript modules (import ... from '...'). */
225
+ module?: boolean;
226
+ /**
227
+ * Determines if the node: prefix is generated for core module imports in environments that support it.
228
+ * This is only applicable to Webpack runtime code.
229
+ * */
230
+ nodePrefixForCoreModules?: boolean;
231
+ /** The environment supports optional chaining ('obj?.a' or 'obj?.()'). */
232
+ optionalChaining?: boolean;
233
+ /** The environment supports template literals. */
234
+ templateLiteral?: boolean;
235
+ };
236
+ export type Output = {
237
+ /**
238
+ * The output directory as an absolute path.
239
+ * @default path.resolve(process.cwd(), 'dist')
240
+ * */
241
+ path?: Path;
242
+ /**
243
+ * Tells Rspack to include comments in bundles with information about the contained modules.
244
+ * @default true
245
+ */
246
+ pathinfo?: Pathinfo;
247
+ /**
248
+ * Before generating the products, whether delete all files in the output directory.
249
+ * @default false
250
+ * */
251
+ clean?: Clean;
252
+ /** This option determines the URL prefix of the referenced resource, such as: image, file, etc. */
253
+ publicPath?: PublicPath;
254
+ /** This option determines the name of each output bundle. */
255
+ filename?: Filename;
256
+ /** This option determines the name of non-initial chunk files. */
257
+ chunkFilename?: ChunkFilename;
258
+ /** Allows you to set the [crossorigin attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for dynamically loaded chunks. */
259
+ crossOriginLoading?: CrossOriginLoading;
260
+ /** This option determines the name of CSS output files on disk. */
261
+ cssFilename?: CssFilename;
262
+ /**
263
+ * Rspack adds some metadata in CSS to parse CSS modules, and this configuration determines whether to compress these metadata.
264
+ *
265
+ * The value is `true` in production mode.
266
+ * The value is `false` in development mode.
267
+ * */
268
+ cssHeadDataCompression?: boolean;
269
+ /** This option determines the name of non-initial CSS output files on disk. */
270
+ cssChunkFilename?: CssChunkFilename;
271
+ /**
272
+ * Customize the main hot update filename. [fullhash] and [runtime] are available as placeholder.
273
+ * @default '[runtime].[fullhash].hot-update.json'
274
+ * */
275
+ hotUpdateMainFilename?: HotUpdateMainFilename;
276
+ /**
277
+ * Customize the filenames of hot update chunks.
278
+ * @default '[id].[fullhash].hot-update.js'
279
+ * */
280
+ hotUpdateChunkFilename?: HotUpdateChunkFilename;
281
+ /**
282
+ * Only used when target is set to 'web', which uses JSONP for loading hot updates.
283
+ * @default 'webpackHotUpdate' + output.uniqueName
284
+ * */
285
+ hotUpdateGlobal?: HotUpdateGlobal;
286
+ /**
287
+ * This option determines the name of each asset modules.
288
+ * @default '[hash][ext][query]'
289
+ * */
290
+ assetModuleFilename?: AssetModuleFilename;
291
+ /** A unique name of the Rspack build to avoid multiple Rspack runtimes to conflict when using globals. */
292
+ uniqueName?: UniqueName;
293
+ /**
294
+ * The global variable is used by Rspack for loading chunks.
295
+ * Determined by output.uniqueName default.
296
+ * */
297
+ chunkLoadingGlobal?: ChunkLoadingGlobal;
298
+ /**
299
+ * List of library types enabled for use by entry points.
300
+ * Determined by output.library and Entry default.
301
+ * */
302
+ enabledLibraryTypes?: EnabledLibraryTypes;
303
+ /** Output a library exposing the exports of your entry point. */
304
+ library?: Library;
305
+ /**
306
+ * Specify which export should be exposed as a library.
307
+ * @deprecated We might drop support for this, so prefer to use output.library.export
308
+ * */
309
+ libraryExport?: LibraryExport;
310
+ /**
311
+ * Configure how the library will be exposed.
312
+ * @deprecated Use output.library.type instead as we might drop support for output.libraryTarget in the future.
313
+ * */
314
+ libraryTarget?: LibraryType;
315
+ /**
316
+ * When using output.library.type: "umd", setting output.umdNamedDefine to true will name the AMD module of the UMD build.
317
+ * @deprecated Use output.library.umdNamedDefine instead.
318
+ */
319
+ umdNamedDefine?: UmdNamedDefine;
320
+ /**
321
+ * Add a comment in the UMD wrapper.
322
+ * @deprecated use output.library.auxiliaryComment instead.
323
+ * */
324
+ auxiliaryComment?: AuxiliaryComment;
325
+ /**
326
+ * Output JavaScript files as module type.
327
+ * Disabled by default as it's an experimental feature. To use it, you must set experiments.outputModule to true.
328
+ * @default false
329
+ */
330
+ module?: OutputModule;
331
+ /** Tell Rspack to remove a module from the module instance cache (require.cache) if it throws an exception when it is required. */
332
+ strictModuleExceptionHandling?: StrictModuleExceptionHandling;
333
+ /**
334
+ * Handle error in module loading as per EcmaScript Modules spec at a performance cost.
335
+ * @default false
336
+ * */
337
+ strictModuleErrorHandling?: StrictModuleErrorHandling;
338
+ /**
339
+ * When targeting a library, especially when library.type is 'umd', this option indicates what global object will be used to mount the library.
340
+ * @default 'self'
341
+ */
342
+ globalObject?: GlobalObject;
343
+ /**
344
+ * The name of the native import() function.
345
+ * @default 'import'
346
+ * */
347
+ importFunctionName?: ImportFunctionName;
348
+ /**
349
+ * The name of the native import.meta object (can be exchanged for a polyfill).
350
+ * @default 'import.meta'
351
+ */
352
+ importMetaName?: ImportMetaName;
353
+ /**
354
+ * Tells Rspack to add IIFE wrapper around emitted code.
355
+ * @default true
356
+ */
357
+ iife?: Iife;
358
+ /**
359
+ * Option to set the method of loading WebAssembly Modules.
360
+ * @default 'fetch'
361
+ * */
362
+ wasmLoading?: WasmLoading;
363
+ /** List of wasm loading types enabled for use by entry points. */
364
+ enabledWasmLoadingTypes?: EnabledWasmLoadingTypes;
365
+ /**
366
+ * Specifies the filename of WebAssembly modules.
367
+ * @default '[hash].module.wasm'
368
+ * */
369
+ webassemblyModuleFilename?: WebassemblyModuleFilename;
370
+ /** The format of chunks (formats included by default are 'array-push' (web/webworker), 'commonjs' (node.js), 'module' (ESM). */
371
+ chunkFormat?: ChunkFormat;
372
+ /** The method to load chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (webworker), 'require' (sync node.js), 'async-node' (async node.js) */
373
+ chunkLoading?: ChunkLoading;
374
+ /** List of chunk loading types enabled for use by entry points. */
375
+ enabledChunkLoadingTypes?: EnabledChunkLoadingTypes;
376
+ /** Controls [Trusted Types](https://web.dev/articles/trusted-types) compatibility. */
377
+ trustedTypes?: true | string | TrustedTypes;
378
+ /**
379
+ * Configure how source maps are named.
380
+ * Only takes effect when devtool is set to 'source-map', which writes an output file.
381
+ * @default '[file].map[query]'
382
+ * */
383
+ sourceMapFilename?: SourceMapFilename;
384
+ /** The encoding to use when generating the hash. */
385
+ hashDigest?: HashDigest;
386
+ /**
387
+ * The prefix length of the hash digest to use.
388
+ * @default 20
389
+ * */
390
+ hashDigestLength?: HashDigestLength;
391
+ /**
392
+ * The hashing algorithm to use.
393
+ * @default 'md4'
394
+ * */
395
+ hashFunction?: HashFunction;
396
+ /** An optional salt to update the hash. */
397
+ hashSalt?: HashSalt;
398
+ /**
399
+ * Create async chunks that are loaded on demand.
400
+ * @default true
401
+ * */
402
+ asyncChunks?: AsyncChunks;
403
+ /**
404
+ * The new option workerChunkLoading controls the chunk loading of workers.
405
+ * @default false
406
+ * */
407
+ workerChunkLoading?: ChunkLoading;
408
+ /**
409
+ * Option to set the method of loading WebAssembly Modules in workers, defaults to the value of output.wasmLoading.
410
+ * @default false
411
+ * */
412
+ workerWasmLoading?: WasmLoading;
413
+ /** Set a public path for Worker, defaults to value of output.publicPath. */
414
+ workerPublicPath?: WorkerPublicPath;
415
+ /**
416
+ * This option allows loading asynchronous chunks with a custom script type.
417
+ * @default false
418
+ * */
419
+ scriptType?: ScriptType;
420
+ /** This option determines the module's namespace used with the output.devtoolModuleFilenameTemplate */
421
+ devtoolNamespace?: DevtoolNamespace;
422
+ /** This option is only used when devtool uses an option that requires module names. */
423
+ devtoolModuleFilenameTemplate?: DevtoolModuleFilenameTemplate;
424
+ /** A fallback is used when the template string or function above yields duplicates. */
425
+ devtoolFallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate;
426
+ /**
427
+ * The Number of milliseconds before chunk request timed out.
428
+ * @default 120000
429
+ * */
430
+ chunkLoadTimeout?: number;
431
+ /**
432
+ * Add charset="utf-8" to the HTML <script> tag.
433
+ * @default true
434
+ * */
435
+ charset?: boolean;
436
+ /** Tell Rspack what kind of ES-features may be used in the generated runtime-code. */
437
+ environment?: Environment;
438
+ };
130
439
  /**
131
440
  * Path alias
132
441
  * @example