@rspack/browser 2.0.5 → 2.0.7
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.
- package/dist/612.js +69 -0
- package/dist/RuntimeGlobals.d.ts +52 -48
- package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +33 -0
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +6 -0
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +11 -0
- package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +16 -0
- package/dist/builtin-plugin/index.d.ts +2 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +2 -2
- package/dist/config/normalization.d.ts +1 -0
- package/dist/config/types.d.ts +41 -20
- package/dist/exports.d.ts +7 -3
- package/dist/index.js +497 -347
- package/dist/napi-binding.d.ts +57 -6
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/sharing/IndependentSharedPlugin.d.ts +3 -0
- package/dist/sharing/SharedContainerPlugin.d.ts +1 -1
- package/dist/sharing/TreeShakingSharedPlugin.d.ts +4 -1
- package/package.json +3 -3
package/dist/612.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __webpack_modules__ = {};
|
|
2
|
+
var __webpack_module_cache__ = {};
|
|
3
|
+
function __webpack_require__(moduleId) {
|
|
4
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
+
exports: {}
|
|
8
|
+
};
|
|
9
|
+
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
10
|
+
return module.exports;
|
|
11
|
+
}
|
|
12
|
+
__webpack_require__.m = __webpack_modules__;
|
|
13
|
+
(()=>{
|
|
14
|
+
__webpack_require__.n = (module)=>{
|
|
15
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
16
|
+
__webpack_require__.d(getter, {
|
|
17
|
+
a: getter
|
|
18
|
+
});
|
|
19
|
+
return getter;
|
|
20
|
+
};
|
|
21
|
+
})();
|
|
22
|
+
(()=>{
|
|
23
|
+
__webpack_require__.d = (exports, getters, values)=>{
|
|
24
|
+
var define = (defs, kind)=>{
|
|
25
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
[kind]: defs[key]
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
define(getters, "get");
|
|
31
|
+
define(values, "value");
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
(()=>{
|
|
35
|
+
__webpack_require__.add = function(modules) {
|
|
36
|
+
Object.assign(__webpack_require__.m, modules);
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
(()=>{
|
|
40
|
+
__webpack_require__.g = (()=>{
|
|
41
|
+
if ('object' == typeof globalThis) return globalThis;
|
|
42
|
+
try {
|
|
43
|
+
return this || new Function('return this')();
|
|
44
|
+
} catch (e) {
|
|
45
|
+
if ('object' == typeof window) return window;
|
|
46
|
+
}
|
|
47
|
+
})();
|
|
48
|
+
})();
|
|
49
|
+
(()=>{
|
|
50
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
51
|
+
})();
|
|
52
|
+
(()=>{
|
|
53
|
+
__webpack_require__.r = (exports)=>{
|
|
54
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
55
|
+
value: 'Module'
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, '__esModule', {
|
|
58
|
+
value: true
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
})();
|
|
62
|
+
(()=>{
|
|
63
|
+
__webpack_require__.nmd = (module)=>{
|
|
64
|
+
module.paths = [];
|
|
65
|
+
if (!module.children) module.children = [];
|
|
66
|
+
return module;
|
|
67
|
+
};
|
|
68
|
+
})();
|
|
69
|
+
export { __webpack_require__ };
|
package/dist/RuntimeGlobals.d.ts
CHANGED
|
@@ -128,112 +128,116 @@ declare enum RuntimeGlobals {
|
|
|
128
128
|
* instantiate a wasm instance from module exports object, id, hash and importsObject
|
|
129
129
|
*/
|
|
130
130
|
instantiateWasm = 28,
|
|
131
|
+
/**
|
|
132
|
+
* compile a wasm module from id and hash
|
|
133
|
+
*/
|
|
134
|
+
compileWasm = 29,
|
|
131
135
|
/**
|
|
132
136
|
* the uncaught error handler for the webpack runtime
|
|
133
137
|
*/
|
|
134
|
-
uncaughtErrorHandler =
|
|
138
|
+
uncaughtErrorHandler = 30,
|
|
135
139
|
/**
|
|
136
140
|
* the script nonce
|
|
137
141
|
*/
|
|
138
|
-
scriptNonce =
|
|
142
|
+
scriptNonce = 31,
|
|
139
143
|
/**
|
|
140
144
|
* function to load a script tag.
|
|
141
145
|
* Arguments: (url: string, done: (event) =\> void), key?: string | number, chunkId?: string | number) =\> void
|
|
142
146
|
* done function is called when loading has finished or timeout occurred.
|
|
143
147
|
* It will attach to existing script tags with data-webpack == uniqueName + ":" + key or src == url.
|
|
144
148
|
*/
|
|
145
|
-
loadScript =
|
|
149
|
+
loadScript = 32,
|
|
146
150
|
/**
|
|
147
151
|
* function to promote a string to a TrustedScript using webpack's Trusted
|
|
148
152
|
* Types policy
|
|
149
153
|
* Arguments: (script: string) =\> TrustedScript
|
|
150
154
|
*/
|
|
151
|
-
createScript =
|
|
155
|
+
createScript = 33,
|
|
152
156
|
/**
|
|
153
157
|
* function to promote a string to a TrustedScriptURL using webpack's Trusted
|
|
154
158
|
* Types policy
|
|
155
159
|
* Arguments: (url: string) =\> TrustedScriptURL
|
|
156
160
|
*/
|
|
157
|
-
createScriptUrl =
|
|
161
|
+
createScriptUrl = 34,
|
|
158
162
|
/**
|
|
159
163
|
* function to return webpack's Trusted Types policy
|
|
160
164
|
* Arguments: () =\> TrustedTypePolicy
|
|
161
165
|
*/
|
|
162
|
-
getTrustedTypesPolicy =
|
|
166
|
+
getTrustedTypesPolicy = 35,
|
|
163
167
|
/**
|
|
164
168
|
* a flag when a chunk has a fetch priority
|
|
165
169
|
*/
|
|
166
|
-
hasFetchPriority =
|
|
170
|
+
hasFetchPriority = 36,
|
|
167
171
|
/**
|
|
168
172
|
* the chunk name of the chunk with the runtime
|
|
169
173
|
*/
|
|
170
|
-
chunkName =
|
|
174
|
+
chunkName = 37,
|
|
171
175
|
/**
|
|
172
176
|
* the runtime id of the current runtime
|
|
173
177
|
*/
|
|
174
|
-
runtimeId =
|
|
178
|
+
runtimeId = 38,
|
|
175
179
|
/**
|
|
176
180
|
* the filename of the script part of the chunk
|
|
177
181
|
*/
|
|
178
|
-
getChunkScriptFilename =
|
|
182
|
+
getChunkScriptFilename = 39,
|
|
179
183
|
/**
|
|
180
184
|
* the filename of the css part of the chunk
|
|
181
185
|
*/
|
|
182
|
-
getChunkCssFilename =
|
|
186
|
+
getChunkCssFilename = 40,
|
|
183
187
|
/**
|
|
184
188
|
* rspack version
|
|
185
189
|
* @internal
|
|
186
190
|
*/
|
|
187
|
-
rspackVersion =
|
|
191
|
+
rspackVersion = 41,
|
|
188
192
|
/**
|
|
189
193
|
* a flag when a module/chunk/tree has css modules
|
|
190
194
|
*/
|
|
191
|
-
hasCssModules =
|
|
195
|
+
hasCssModules = 42,
|
|
192
196
|
/**
|
|
193
197
|
* rspack unique id
|
|
194
198
|
* @internal
|
|
195
199
|
*/
|
|
196
|
-
rspackUniqueId =
|
|
200
|
+
rspackUniqueId = 43,
|
|
197
201
|
/**
|
|
198
202
|
* the filename of the script part of the hot update chunk
|
|
199
203
|
*/
|
|
200
|
-
getChunkUpdateScriptFilename =
|
|
204
|
+
getChunkUpdateScriptFilename = 44,
|
|
201
205
|
/**
|
|
202
206
|
* the filename of the css part of the hot update chunk
|
|
203
207
|
*/
|
|
204
|
-
getChunkUpdateCssFilename =
|
|
208
|
+
getChunkUpdateCssFilename = 45,
|
|
205
209
|
/**
|
|
206
210
|
* startup signal from runtime
|
|
207
211
|
* This will be called when the runtime chunk has been loaded.
|
|
208
212
|
*/
|
|
209
|
-
startup =
|
|
213
|
+
startup = 46,
|
|
210
214
|
/**
|
|
211
215
|
* @deprecated
|
|
212
216
|
* creating a default startup function with the entry modules
|
|
213
217
|
*/
|
|
214
|
-
startupNoDefault =
|
|
218
|
+
startupNoDefault = 47,
|
|
215
219
|
/**
|
|
216
220
|
* startup signal from runtime but only used to add logic after the startup
|
|
217
221
|
*/
|
|
218
|
-
startupOnlyAfter =
|
|
222
|
+
startupOnlyAfter = 48,
|
|
219
223
|
/**
|
|
220
224
|
* startup signal from runtime but only used to add sync logic before the startup
|
|
221
225
|
*/
|
|
222
|
-
startupOnlyBefore =
|
|
226
|
+
startupOnlyBefore = 49,
|
|
223
227
|
/**
|
|
224
228
|
* global callback functions for installing chunks
|
|
225
229
|
*/
|
|
226
|
-
chunkCallback =
|
|
230
|
+
chunkCallback = 50,
|
|
227
231
|
/**
|
|
228
232
|
* method to startup an entrypoint with needed chunks.
|
|
229
233
|
* Signature: (moduleId: Id, chunkIds: Id[]) =\> any.
|
|
230
234
|
* Returns the exports of the module or a Promise
|
|
231
235
|
*/
|
|
232
|
-
startupEntrypoint =
|
|
236
|
+
startupEntrypoint = 51,
|
|
233
237
|
/**
|
|
234
238
|
* startup signal from runtime for chunk dependencies
|
|
235
239
|
*/
|
|
236
|
-
startupChunkDependencies =
|
|
240
|
+
startupChunkDependencies = 52,
|
|
237
241
|
/**
|
|
238
242
|
* register deferred code, which will run when certain
|
|
239
243
|
* chunks are loaded.
|
|
@@ -242,87 +246,87 @@ declare enum RuntimeGlobals {
|
|
|
242
246
|
* When (priority & 1) it will wait for all other handlers with lower priority to
|
|
243
247
|
* be executed before itself is executed
|
|
244
248
|
*/
|
|
245
|
-
onChunksLoaded =
|
|
249
|
+
onChunksLoaded = 53,
|
|
246
250
|
/**
|
|
247
251
|
* method to install a chunk that was loaded somehow
|
|
248
252
|
* Signature: (\{ id, ids, modules, runtime \}) =\> void
|
|
249
253
|
*/
|
|
250
|
-
externalInstallChunk =
|
|
254
|
+
externalInstallChunk = 54,
|
|
251
255
|
/**
|
|
252
256
|
* interceptor for module executions
|
|
253
257
|
*/
|
|
254
|
-
interceptModuleExecution =
|
|
258
|
+
interceptModuleExecution = 55,
|
|
255
259
|
/**
|
|
256
260
|
* the global object
|
|
257
261
|
*/
|
|
258
|
-
global =
|
|
262
|
+
global = 56,
|
|
259
263
|
/**
|
|
260
264
|
* an object with all share scopes
|
|
261
265
|
*/
|
|
262
|
-
shareScopeMap =
|
|
266
|
+
shareScopeMap = 57,
|
|
263
267
|
/**
|
|
264
268
|
* The sharing init sequence function (only runs once per share scope).
|
|
265
269
|
* Has one argument, the name of the share scope.
|
|
266
270
|
* Creates a share scope if not existing
|
|
267
271
|
*/
|
|
268
|
-
initializeSharing =
|
|
272
|
+
initializeSharing = 58,
|
|
269
273
|
/**
|
|
270
274
|
* The current scope when getting a module from a remote
|
|
271
275
|
*/
|
|
272
|
-
currentRemoteGetScope =
|
|
276
|
+
currentRemoteGetScope = 59,
|
|
273
277
|
/**
|
|
274
278
|
* the filename of the HMR manifest
|
|
275
279
|
*/
|
|
276
|
-
getUpdateManifestFilename =
|
|
280
|
+
getUpdateManifestFilename = 60,
|
|
277
281
|
/**
|
|
278
282
|
* function downloading the update manifest
|
|
279
283
|
*/
|
|
280
|
-
hmrDownloadManifest =
|
|
284
|
+
hmrDownloadManifest = 61,
|
|
281
285
|
/**
|
|
282
286
|
* array with handler functions to download chunk updates
|
|
283
287
|
*/
|
|
284
|
-
hmrDownloadUpdateHandlers =
|
|
288
|
+
hmrDownloadUpdateHandlers = 62,
|
|
285
289
|
/**
|
|
286
290
|
* object with all hmr module data for all modules
|
|
287
291
|
*/
|
|
288
|
-
hmrModuleData =
|
|
292
|
+
hmrModuleData = 63,
|
|
289
293
|
/**
|
|
290
294
|
* array with handler functions when a module should be invalidated
|
|
291
295
|
*/
|
|
292
|
-
hmrInvalidateModuleHandlers =
|
|
296
|
+
hmrInvalidateModuleHandlers = 64,
|
|
293
297
|
/**
|
|
294
298
|
* the prefix for storing state of runtime modules when hmr is enabled
|
|
295
299
|
*/
|
|
296
|
-
hmrRuntimeStatePrefix =
|
|
300
|
+
hmrRuntimeStatePrefix = 65,
|
|
297
301
|
/**
|
|
298
302
|
* the AMD define function
|
|
299
303
|
*/
|
|
300
|
-
amdDefine =
|
|
304
|
+
amdDefine = 66,
|
|
301
305
|
/**
|
|
302
306
|
* the AMD options
|
|
303
307
|
*/
|
|
304
|
-
amdOptions =
|
|
308
|
+
amdOptions = 67,
|
|
305
309
|
/**
|
|
306
310
|
* the System polyfill object
|
|
307
311
|
*/
|
|
308
|
-
system =
|
|
312
|
+
system = 68,
|
|
309
313
|
/**
|
|
310
314
|
* the shorthand for Object.prototype.hasOwnProperty
|
|
311
315
|
* using of it decreases the compiled bundle size
|
|
312
316
|
*/
|
|
313
|
-
hasOwnProperty =
|
|
317
|
+
hasOwnProperty = 69,
|
|
314
318
|
/**
|
|
315
319
|
* the System.register context object
|
|
316
320
|
*/
|
|
317
|
-
systemContext =
|
|
321
|
+
systemContext = 70,
|
|
318
322
|
/**
|
|
319
323
|
* the baseURI of current document
|
|
320
324
|
*/
|
|
321
|
-
baseURI =
|
|
325
|
+
baseURI = 71,
|
|
322
326
|
/**
|
|
323
327
|
* a RelativeURL class when relative URLs are used
|
|
324
328
|
*/
|
|
325
|
-
relativeUrl =
|
|
329
|
+
relativeUrl = 72,
|
|
326
330
|
/**
|
|
327
331
|
* Creates an async module. The body function must be a async function.
|
|
328
332
|
* "module.exports" will be decorated with an AsyncModulePromise.
|
|
@@ -335,10 +339,10 @@ declare enum RuntimeGlobals {
|
|
|
335
339
|
* hasAwaitAfterDependencies?: boolean
|
|
336
340
|
* ) =\> void
|
|
337
341
|
*/
|
|
338
|
-
asyncModule =
|
|
339
|
-
asyncModuleExportSymbol =
|
|
340
|
-
makeDeferredNamespaceObject =
|
|
341
|
-
makeDeferredNamespaceObjectSymbol =
|
|
342
|
+
asyncModule = 73,
|
|
343
|
+
asyncModuleExportSymbol = 74,
|
|
344
|
+
makeDeferredNamespaceObject = 75,
|
|
345
|
+
makeDeferredNamespaceObjectSymbol = 76
|
|
342
346
|
}
|
|
343
347
|
export declare const isReservedRuntimeGlobal: (r: string, compilerRuntimeGlobals: Record<string, string>) => boolean;
|
|
344
348
|
export declare function renderModulePrefix(_compilerOptions: RspackOptionsNormalized): string;
|
|
@@ -352,5 +356,5 @@ export declare enum RuntimeVariable {
|
|
|
352
356
|
}
|
|
353
357
|
export declare function renderRuntimeVariables(variable: RuntimeVariable, _compilerOptions?: RspackOptionsNormalized): string;
|
|
354
358
|
export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): Record<keyof typeof RuntimeGlobals, string>;
|
|
355
|
-
declare const DefaultRuntimeGlobals: Record<"amdDefine" | "amdOptions" | "asyncModule" | "asyncModuleExportSymbol" | "baseURI" | "chunkCallback" | "chunkName" | "compatGetDefaultExport" | "createFakeNamespaceObject" | "createScript" | "createScriptUrl" | "currentRemoteGetScope" | "definePropertyGetters" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "entryModuleId" | "exports" | "externalInstallChunk" | "getChunkCssFilename" | "getChunkScriptFilename" | "getChunkUpdateCssFilename" | "getChunkUpdateScriptFilename" | "getFullHash" | "getTrustedTypesPolicy" | "getUpdateManifestFilename" | "global" | "harmonyModuleDecorator" | "hasCssModules" | "hasFetchPriority" | "hasOwnProperty" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrInvalidateModuleHandlers" | "hmrModuleData" | "hmrRuntimeStatePrefix" | "initializeSharing" | "instantiateWasm" | "interceptModuleExecution" | "loadScript" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol" | "makeNamespaceObject" | "module" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "moduleId" | "moduleLoaded" | "nodeModuleDecorator" | "onChunksLoaded" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "publicPath" | "relativeUrl" | "require" | "requireScope" | "returnExportsFromRuntime" | "rspackUniqueId" | "rspackVersion" | "runtimeId" | "scriptNonce" | "shareScopeMap" | "startup" | "startupChunkDependencies" | "startupEntrypoint" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "system" | "systemContext" | "thisAsExports" | "uncaughtErrorHandler" | "wasmInstances", string>;
|
|
359
|
+
declare const DefaultRuntimeGlobals: Record<"amdDefine" | "amdOptions" | "asyncModule" | "asyncModuleExportSymbol" | "baseURI" | "chunkCallback" | "chunkName" | "compatGetDefaultExport" | "compileWasm" | "createFakeNamespaceObject" | "createScript" | "createScriptUrl" | "currentRemoteGetScope" | "definePropertyGetters" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "entryModuleId" | "exports" | "externalInstallChunk" | "getChunkCssFilename" | "getChunkScriptFilename" | "getChunkUpdateCssFilename" | "getChunkUpdateScriptFilename" | "getFullHash" | "getTrustedTypesPolicy" | "getUpdateManifestFilename" | "global" | "harmonyModuleDecorator" | "hasCssModules" | "hasFetchPriority" | "hasOwnProperty" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrInvalidateModuleHandlers" | "hmrModuleData" | "hmrRuntimeStatePrefix" | "initializeSharing" | "instantiateWasm" | "interceptModuleExecution" | "loadScript" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol" | "makeNamespaceObject" | "module" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "moduleId" | "moduleLoaded" | "nodeModuleDecorator" | "onChunksLoaded" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "publicPath" | "relativeUrl" | "require" | "requireScope" | "returnExportsFromRuntime" | "rspackUniqueId" | "rspackVersion" | "runtimeId" | "scriptNonce" | "shareScopeMap" | "startup" | "startupChunkDependencies" | "startupEntrypoint" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "system" | "systemContext" | "thisAsExports" | "uncaughtErrorHandler" | "wasmInstances", string>;
|
|
356
360
|
export { DefaultRuntimeGlobals as RuntimeGlobals };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
|
+
import type { Compilation } from '../Compilation';
|
|
3
|
+
import type { Compiler } from '../Compiler';
|
|
4
|
+
import type { Module } from '../Module';
|
|
5
|
+
import { RspackBuiltinPlugin } from './base';
|
|
6
|
+
export type CircularCheckRspackPluginOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* Exclude detection of files based on a RegExp.
|
|
9
|
+
*/
|
|
10
|
+
exclude?: RegExp;
|
|
11
|
+
/**
|
|
12
|
+
* Include specific files based on a RegExp.
|
|
13
|
+
*/
|
|
14
|
+
include?: RegExp;
|
|
15
|
+
/**
|
|
16
|
+
* Add errors to rspack instead of warnings.
|
|
17
|
+
*/
|
|
18
|
+
failOnError?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Called for each detected circular dependency.
|
|
21
|
+
*/
|
|
22
|
+
onDetected?(args: {
|
|
23
|
+
module: Module;
|
|
24
|
+
paths: string[];
|
|
25
|
+
compilation: Compilation;
|
|
26
|
+
}): void;
|
|
27
|
+
};
|
|
28
|
+
export declare class CircularCheckRspackPlugin extends RspackBuiltinPlugin {
|
|
29
|
+
name: BuiltinPluginName;
|
|
30
|
+
_options: CircularCheckRspackPluginOptions;
|
|
31
|
+
constructor(options?: CircularCheckRspackPluginOptions);
|
|
32
|
+
raw(compiler: Compiler): BuiltinPlugin;
|
|
33
|
+
}
|
|
@@ -3,6 +3,9 @@ import type { Compilation } from '../Compilation';
|
|
|
3
3
|
import type { Compiler } from '../Compiler';
|
|
4
4
|
import type { Module } from '../Module';
|
|
5
5
|
import { RspackBuiltinPlugin } from './base';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `CircularCheckRspackPluginOptions` instead.
|
|
8
|
+
*/
|
|
6
9
|
export type CircularDependencyRspackPluginOptions = {
|
|
7
10
|
/**
|
|
8
11
|
* When `true`, the plugin will emit `ERROR` diagnostics rather than the
|
|
@@ -46,6 +49,9 @@ export type CircularDependencyRspackPluginOptions = {
|
|
|
46
49
|
*/
|
|
47
50
|
onEnd?(compilation: Compilation): void;
|
|
48
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Use `CircularCheckRspackPlugin` instead.
|
|
54
|
+
*/
|
|
49
55
|
export declare class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
|
|
50
56
|
name: BuiltinPluginName;
|
|
51
57
|
_options: CircularDependencyRspackPluginOptions;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from './base';
|
|
3
|
+
import type { Module } from '../Module';
|
|
4
|
+
export interface DeterministicModuleIdsPluginOptions {
|
|
5
|
+
context?: string;
|
|
6
|
+
test?: (module: Module) => boolean;
|
|
7
|
+
maxLength?: number;
|
|
8
|
+
salt?: number;
|
|
9
|
+
fixedLength?: boolean;
|
|
10
|
+
failOnConflict?: boolean;
|
|
11
|
+
}
|
|
3
12
|
export declare class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
13
|
+
private options;
|
|
4
14
|
name: BuiltinPluginName;
|
|
5
15
|
affectedHooks: 'compilation';
|
|
16
|
+
constructor(options?: DeterministicModuleIdsPluginOptions);
|
|
6
17
|
raw(): BuiltinPlugin;
|
|
7
18
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
|
+
import type { Module } from '../Module';
|
|
3
|
+
import { RspackBuiltinPlugin } from './base';
|
|
4
|
+
export interface SyncModuleIdsPluginOptions {
|
|
5
|
+
path: string;
|
|
6
|
+
context?: string;
|
|
7
|
+
test?: (module: Module) => boolean;
|
|
8
|
+
mode?: 'read' | 'create' | 'merge' | 'update';
|
|
9
|
+
}
|
|
10
|
+
export declare class SyncModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
11
|
+
private options;
|
|
12
|
+
name: BuiltinPluginName;
|
|
13
|
+
affectedHooks: 'compilation';
|
|
14
|
+
constructor(options: SyncModuleIdsPluginOptions);
|
|
15
|
+
raw(): BuiltinPlugin;
|
|
16
|
+
}
|
|
@@ -8,6 +8,7 @@ export { createNativePlugin, RspackBuiltinPlugin } from './base';
|
|
|
8
8
|
export * from './CaseSensitivePlugin';
|
|
9
9
|
export * from './ChunkPrefetchPreloadPlugin';
|
|
10
10
|
export * from './CircularModulesInfoPlugin';
|
|
11
|
+
export * from './CircularCheckRspackPlugin';
|
|
11
12
|
export * from './CircularDependencyRspackPlugin';
|
|
12
13
|
export * from './CommonJsChunkFormatPlugin';
|
|
13
14
|
export * from './ContextReplacementPlugin';
|
|
@@ -84,5 +85,6 @@ export * from './SourceMapDevToolPlugin';
|
|
|
84
85
|
export * from './SplitChunksPlugin';
|
|
85
86
|
export * from './SubresourceIntegrityPlugin';
|
|
86
87
|
export * from './SwcJsMinimizerPlugin';
|
|
88
|
+
export * from './SyncModuleIdsPlugin';
|
|
87
89
|
export * from './URLPlugin';
|
|
88
90
|
export * from './WorkerPlugin';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Module } from '../../Module';
|
|
2
2
|
export declare const BuiltinLazyCompilationPlugin: {
|
|
3
|
-
new (currentActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, test?: RegExp | ((module: Module) => boolean) | undefined): {
|
|
3
|
+
new (currentActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, reservedExternals: string[], test?: RegExp | ((module: Module) => boolean) | undefined): {
|
|
4
4
|
name: string;
|
|
5
|
-
_args: [currentActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, test?: RegExp | ((module: Module) => boolean) | undefined];
|
|
5
|
+
_args: [currentActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, reservedExternals: string[], test?: RegExp | ((module: Module) => boolean) | undefined];
|
|
6
6
|
affectedHooks: keyof import("../..").CompilerHooks | undefined;
|
|
7
7
|
raw(compiler: import("../..").Compiler): import("../../binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../..").Compiler): void;
|
|
@@ -102,6 +102,7 @@ export interface ExperimentsNormalized {
|
|
|
102
102
|
useInputFileSystem?: false | RegExp[];
|
|
103
103
|
nativeWatcher?: boolean;
|
|
104
104
|
deferImport?: boolean;
|
|
105
|
+
sourceImport?: boolean;
|
|
105
106
|
pureFunctions?: boolean;
|
|
106
107
|
}
|
|
107
108
|
export type IgnoreWarningsNormalized = ((warning: WebpackError, compilation: Compilation) => boolean)[];
|
package/dist/config/types.d.ts
CHANGED
|
@@ -669,6 +669,8 @@ export type RuleSetRule = RuleSetRuleUseAndLoader & {
|
|
|
669
669
|
issuerLayer?: RuleSetCondition;
|
|
670
670
|
/** Matches all modules that match this resource, and will match against the category of the dependency that introduced the current module */
|
|
671
671
|
dependency?: RuleSetCondition;
|
|
672
|
+
/** Matches all modules by the import phase that introduced the current module. */
|
|
673
|
+
phase?: RuleSetCondition;
|
|
672
674
|
/** Matches all modules that match this resource, and will match against Resource */
|
|
673
675
|
resource?: RuleSetCondition;
|
|
674
676
|
/** Matches all modules that match this resource against the Resource's fragment. */
|
|
@@ -764,23 +766,8 @@ export type CssParserOptions = {
|
|
|
764
766
|
* @default true
|
|
765
767
|
* */
|
|
766
768
|
resolveImport?: CssParserResolveImport;
|
|
767
|
-
/**
|
|
768
|
-
* Enable/disable renaming of `@keyframes`.
|
|
769
|
-
* @default true
|
|
770
|
-
*/
|
|
771
|
-
animation?: boolean;
|
|
772
|
-
/**
|
|
773
|
-
* Enable/disable renaming of custom identifiers.
|
|
774
|
-
* @default false
|
|
775
|
-
*/
|
|
776
|
-
customIdents?: boolean;
|
|
777
|
-
/**
|
|
778
|
-
* Enable/disable renaming of dashed identifiers, e.g. custom properties.
|
|
779
|
-
* @default false
|
|
780
|
-
*/
|
|
781
|
-
dashedIdents?: boolean;
|
|
782
769
|
};
|
|
783
|
-
/** Options object for `css/
|
|
770
|
+
/** Options object for `css/global` modules. */
|
|
784
771
|
export type CssModuleParserOptions = {
|
|
785
772
|
/**
|
|
786
773
|
* Use ES modules named export for CSS exports.
|
|
@@ -807,16 +794,39 @@ export type CssModuleParserOptions = {
|
|
|
807
794
|
* @default true
|
|
808
795
|
*/
|
|
809
796
|
animation?: boolean;
|
|
797
|
+
/**
|
|
798
|
+
* Enable/disable renaming of container names.
|
|
799
|
+
* @default true
|
|
800
|
+
*/
|
|
801
|
+
container?: boolean;
|
|
810
802
|
/**
|
|
811
803
|
* Enable/disable renaming of custom identifiers.
|
|
812
|
-
* @default
|
|
804
|
+
* @default true
|
|
813
805
|
*/
|
|
814
806
|
customIdents?: boolean;
|
|
815
807
|
/**
|
|
816
808
|
* Enable/disable renaming of dashed identifiers, e.g. custom properties.
|
|
817
|
-
* @default
|
|
809
|
+
* @default true
|
|
818
810
|
*/
|
|
819
811
|
dashedIdents?: boolean;
|
|
812
|
+
/**
|
|
813
|
+
* Enable/disable renaming of CSS function names.
|
|
814
|
+
* @default true
|
|
815
|
+
*/
|
|
816
|
+
function?: boolean;
|
|
817
|
+
/**
|
|
818
|
+
* Enable/disable renaming of grid names.
|
|
819
|
+
* @default true
|
|
820
|
+
*/
|
|
821
|
+
grid?: boolean;
|
|
822
|
+
};
|
|
823
|
+
/** Options object for `css/auto` and `css/module` modules. */
|
|
824
|
+
export type CssAutoOrModuleParserOptions = CssModuleParserOptions & {
|
|
825
|
+
/**
|
|
826
|
+
* Enable strict pure mode: every selector must contain at least one local class or id selector.
|
|
827
|
+
* @default false
|
|
828
|
+
*/
|
|
829
|
+
pure?: boolean;
|
|
820
830
|
};
|
|
821
831
|
type ExportsPresence = 'error' | 'warn' | 'auto' | false;
|
|
822
832
|
export type JavascriptParserCommonjsExports = boolean | 'skipInEsm';
|
|
@@ -932,6 +942,12 @@ export type JavascriptParserOptions = {
|
|
|
932
942
|
* @default false
|
|
933
943
|
*/
|
|
934
944
|
deferImport?: boolean;
|
|
945
|
+
/**
|
|
946
|
+
* Whether to enable source phase import.
|
|
947
|
+
* This option is controlled by `experiments.sourceImport` and should not be set directly.
|
|
948
|
+
* @default false
|
|
949
|
+
*/
|
|
950
|
+
sourceImport?: boolean;
|
|
935
951
|
/**
|
|
936
952
|
* Whether to enable import.meta.resolve().
|
|
937
953
|
* @default false
|
|
@@ -960,11 +976,11 @@ export type ParserOptionsByModuleTypeKnown = {
|
|
|
960
976
|
/** Parser options for `css` modules. */
|
|
961
977
|
css?: CssParserOptions;
|
|
962
978
|
/** Parser options for `css/auto` modules. */
|
|
963
|
-
'css/auto'?:
|
|
979
|
+
'css/auto'?: CssAutoOrModuleParserOptions;
|
|
964
980
|
/** Parser options for `css/global` modules. */
|
|
965
981
|
'css/global'?: CssModuleParserOptions;
|
|
966
982
|
/** Parser options for `css/module` modules. */
|
|
967
|
-
'css/module'?:
|
|
983
|
+
'css/module'?: CssAutoOrModuleParserOptions;
|
|
968
984
|
/** Parser options for `javascript` modules. */
|
|
969
985
|
javascript?: JavascriptParserOptions;
|
|
970
986
|
/** Parser options for `javascript/auto` modules. */
|
|
@@ -2276,6 +2292,11 @@ export type Experiments = {
|
|
|
2276
2292
|
* @default false
|
|
2277
2293
|
*/
|
|
2278
2294
|
deferImport?: boolean;
|
|
2295
|
+
/**
|
|
2296
|
+
* Enable source phase import feature
|
|
2297
|
+
* @default false
|
|
2298
|
+
*/
|
|
2299
|
+
sourceImport?: boolean;
|
|
2279
2300
|
/**
|
|
2280
2301
|
* Enable pure-function-based side-effects analysis.
|
|
2281
2302
|
* @default false
|
package/dist/exports.d.ts
CHANGED
|
@@ -79,8 +79,9 @@ interface Electron {
|
|
|
79
79
|
ElectronTargetPlugin: typeof ElectronTargetPlugin;
|
|
80
80
|
}
|
|
81
81
|
export declare const electron: Electron;
|
|
82
|
-
import { HashedModuleIdsPlugin } from './builtin-plugin';
|
|
82
|
+
import { DeterministicModuleIdsPlugin, HashedModuleIdsPlugin, SyncModuleIdsPlugin } from './builtin-plugin';
|
|
83
83
|
interface Ids {
|
|
84
|
+
DeterministicModuleIdsPlugin: typeof DeterministicModuleIdsPlugin;
|
|
84
85
|
HashedModuleIdsPlugin: typeof HashedModuleIdsPlugin;
|
|
85
86
|
}
|
|
86
87
|
export declare const ids: Ids;
|
|
@@ -142,8 +143,8 @@ export declare const sharing: {
|
|
|
142
143
|
};
|
|
143
144
|
export type { FeatureOptions as LightningcssFeatureOptions, LoaderOptions as LightningcssLoaderOptions, } from './builtin-loader/lightningcss/index';
|
|
144
145
|
export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig, } from './builtin-loader/swc/index';
|
|
145
|
-
export type { CircularDependencyRspackPluginOptions, CopyRspackPluginOptions, CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions, EvalDevToolModulePluginOptions, HtmlRspackPluginOptions, LightningCssMinimizerRspackPluginOptions, RsdoctorPluginData, RsdoctorPluginHooks, SourceMapDevToolPluginOptions, SubresourceIntegrityPluginOptions, SwcJsMinimizerRspackPluginOptions, } from './builtin-plugin';
|
|
146
|
-
export { CircularDependencyRspackPlugin, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, HtmlRspackPlugin, LightningCssMinimizerRspackPlugin, NormalModuleReplacementPlugin, SourceMapDevToolPlugin, SwcJsMinimizerRspackPlugin, } from './builtin-plugin';
|
|
146
|
+
export type { CircularCheckRspackPluginOptions, CircularDependencyRspackPluginOptions, CopyRspackPluginOptions, CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions, EvalDevToolModulePluginOptions, HtmlRspackPluginOptions, LightningCssMinimizerRspackPluginOptions, RsdoctorPluginData, RsdoctorPluginHooks, SourceMapDevToolPluginOptions, SubresourceIntegrityPluginOptions, SwcJsMinimizerRspackPluginOptions, } from './builtin-plugin';
|
|
147
|
+
export { CircularCheckRspackPlugin, CircularDependencyRspackPlugin, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, HtmlRspackPlugin, LightningCssMinimizerRspackPlugin, NormalModuleReplacementPlugin, SourceMapDevToolPlugin, SwcJsMinimizerRspackPlugin, } from './builtin-plugin';
|
|
147
148
|
import { EnforceExtension, ResolverFactory, async as resolveAsync, sync as resolveSync } from './binding';
|
|
148
149
|
import { createNativePlugin } from './builtin-plugin';
|
|
149
150
|
import { minify, minifySync, transform, transformSync } from './swc';
|
|
@@ -172,6 +173,9 @@ interface Experiments {
|
|
|
172
173
|
CssChunkingPlugin: typeof CssChunkingPlugin;
|
|
173
174
|
createNativePlugin: typeof createNativePlugin;
|
|
174
175
|
VirtualModulesPlugin: typeof VirtualModulesPlugin;
|
|
176
|
+
ids: {
|
|
177
|
+
SyncModuleIdsPlugin: typeof SyncModuleIdsPlugin;
|
|
178
|
+
};
|
|
175
179
|
rsc: typeof rsc;
|
|
176
180
|
}
|
|
177
181
|
export declare const experiments: Experiments;
|