@rspack/browser 1.6.6 → 1.6.8
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/Compilation.d.ts +1 -1
- package/dist/RuntimeGlobals.d.ts +106 -78
- package/dist/builtin-plugin/css-extract/loader.d.ts +4 -4
- package/dist/index.mjs +645 -449
- package/dist/napi-binding.d.ts +1 -0
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/wasi-worker-browser.mjs +1 -1
- package/package.json +1 -1
package/dist/Compilation.d.ts
CHANGED
package/dist/RuntimeGlobals.d.ts
CHANGED
|
@@ -8,217 +8,232 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import type { JsRuntimeGlobals } from "./binding";
|
|
11
|
-
|
|
12
|
-
export declare function
|
|
13
|
-
export declare
|
|
11
|
+
import type { RspackOptionsNormalized } from "./config";
|
|
12
|
+
export declare function __from_binding_runtime_globals(runtimeRequirements: JsRuntimeGlobals, compilerRuntimeGlobals: Record<string, string>): Set<string>;
|
|
13
|
+
export declare function __to_binding_runtime_globals(runtimeRequirements: Set<string>, compilerRuntimeGlobals: Record<string, string>): JsRuntimeGlobals;
|
|
14
|
+
declare enum RuntimeGlobals {
|
|
14
15
|
/**
|
|
15
16
|
* the internal require function
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
+
require = 0,
|
|
18
19
|
/**
|
|
19
20
|
* access to properties of the internal require function/object
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
requireScope = 1,
|
|
22
23
|
/**
|
|
23
24
|
* the internal exports object
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
|
+
exports = 2,
|
|
26
27
|
/**
|
|
27
28
|
* top-level this need to be the exports object
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
+
thisAsExports = 3,
|
|
30
31
|
/**
|
|
31
32
|
* runtime need to return the exports of the last entry module
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
|
+
returnExportsFromRuntime = 4,
|
|
34
35
|
/**
|
|
35
36
|
* the internal module object
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
+
module = 5,
|
|
38
39
|
/**
|
|
39
40
|
* the internal module object
|
|
40
41
|
*/
|
|
41
|
-
|
|
42
|
+
moduleId = 6,
|
|
42
43
|
/**
|
|
43
44
|
* the internal module object
|
|
44
45
|
*/
|
|
45
|
-
|
|
46
|
+
moduleLoaded = 7,
|
|
46
47
|
/**
|
|
47
48
|
* the bundle public path
|
|
48
49
|
*/
|
|
49
|
-
|
|
50
|
+
publicPath = 8,
|
|
50
51
|
/**
|
|
51
52
|
* the module id of the entry point
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
|
+
entryModuleId = 9,
|
|
54
55
|
/**
|
|
55
56
|
* the module cache
|
|
56
57
|
*/
|
|
57
|
-
|
|
58
|
+
moduleCache = 10,
|
|
58
59
|
/**
|
|
59
60
|
* the module functions
|
|
60
61
|
*/
|
|
61
|
-
|
|
62
|
+
moduleFactories = 11,
|
|
62
63
|
/**
|
|
63
64
|
* the module functions, with only write access
|
|
64
65
|
*/
|
|
65
|
-
|
|
66
|
+
moduleFactoriesAddOnly = 12,
|
|
66
67
|
/**
|
|
67
68
|
* the chunk ensure function
|
|
68
69
|
*/
|
|
69
|
-
|
|
70
|
+
ensureChunk = 13,
|
|
70
71
|
/**
|
|
71
72
|
* an object with handlers to ensure a chunk
|
|
72
73
|
*/
|
|
73
|
-
|
|
74
|
+
ensureChunkHandlers = 14,
|
|
74
75
|
/**
|
|
75
76
|
* a runtime requirement if ensureChunkHandlers should include loading of chunk needed for entries
|
|
76
77
|
*/
|
|
77
|
-
|
|
78
|
+
ensureChunkIncludeEntries = 15,
|
|
78
79
|
/**
|
|
79
80
|
* the chunk prefetch function
|
|
80
81
|
*/
|
|
81
|
-
|
|
82
|
+
prefetchChunk = 16,
|
|
82
83
|
/**
|
|
83
84
|
* an object with handlers to prefetch a chunk
|
|
84
85
|
*/
|
|
85
|
-
|
|
86
|
+
prefetchChunkHandlers = 17,
|
|
86
87
|
/**
|
|
87
88
|
* the chunk preload function
|
|
88
89
|
*/
|
|
89
|
-
|
|
90
|
+
preloadChunk = 18,
|
|
90
91
|
/**
|
|
91
92
|
* an object with handlers to preload a chunk
|
|
92
93
|
*/
|
|
93
|
-
|
|
94
|
+
preloadChunkHandlers = 19,
|
|
94
95
|
/**
|
|
95
96
|
* the exported property define getters function
|
|
96
97
|
*/
|
|
97
|
-
|
|
98
|
+
definePropertyGetters = 20,
|
|
98
99
|
/**
|
|
99
100
|
* define compatibility on export
|
|
100
101
|
*/
|
|
101
|
-
|
|
102
|
+
makeNamespaceObject = 21,
|
|
102
103
|
/**
|
|
103
104
|
* create a fake namespace object
|
|
104
105
|
*/
|
|
105
|
-
|
|
106
|
+
createFakeNamespaceObject = 22,
|
|
106
107
|
/**
|
|
107
108
|
* compatibility get default export
|
|
108
109
|
*/
|
|
109
|
-
|
|
110
|
+
compatGetDefaultExport = 23,
|
|
110
111
|
/**
|
|
111
112
|
* ES modules decorator
|
|
112
113
|
*/
|
|
113
|
-
|
|
114
|
+
harmonyModuleDecorator = 24,
|
|
114
115
|
/**
|
|
115
116
|
* node.js module decorator
|
|
116
117
|
*/
|
|
117
|
-
|
|
118
|
+
nodeModuleDecorator = 25,
|
|
118
119
|
/**
|
|
119
120
|
* the webpack hash
|
|
120
121
|
*/
|
|
121
|
-
|
|
122
|
+
getFullHash = 26,
|
|
122
123
|
/**
|
|
123
124
|
* an object containing all installed WebAssembly.Instance export objects keyed by module id
|
|
124
125
|
*/
|
|
125
|
-
|
|
126
|
+
wasmInstances = 27,
|
|
126
127
|
/**
|
|
127
128
|
* instantiate a wasm instance from module exports object, id, hash and importsObject
|
|
128
129
|
*/
|
|
129
|
-
|
|
130
|
+
instantiateWasm = 28,
|
|
130
131
|
/**
|
|
131
132
|
* the uncaught error handler for the webpack runtime
|
|
132
133
|
*/
|
|
133
|
-
|
|
134
|
+
uncaughtErrorHandler = 29,
|
|
134
135
|
/**
|
|
135
136
|
* the script nonce
|
|
136
137
|
*/
|
|
137
|
-
|
|
138
|
+
scriptNonce = 30,
|
|
138
139
|
/**
|
|
139
140
|
* function to load a script tag.
|
|
140
141
|
* Arguments: (url: string, done: (event) =\> void), key?: string | number, chunkId?: string | number) =\> void
|
|
141
142
|
* done function is called when loading has finished or timeout occurred.
|
|
142
143
|
* It will attach to existing script tags with data-webpack == uniqueName + ":" + key or src == url.
|
|
143
144
|
*/
|
|
144
|
-
|
|
145
|
+
loadScript = 31,
|
|
145
146
|
/**
|
|
146
147
|
* function to promote a string to a TrustedScript using webpack's Trusted
|
|
147
148
|
* Types policy
|
|
148
149
|
* Arguments: (script: string) =\> TrustedScript
|
|
149
150
|
*/
|
|
150
|
-
|
|
151
|
+
createScript = 32,
|
|
151
152
|
/**
|
|
152
153
|
* function to promote a string to a TrustedScriptURL using webpack's Trusted
|
|
153
154
|
* Types policy
|
|
154
155
|
* Arguments: (url: string) =\> TrustedScriptURL
|
|
155
156
|
*/
|
|
156
|
-
|
|
157
|
+
createScriptUrl = 33,
|
|
157
158
|
/**
|
|
158
159
|
* function to return webpack's Trusted Types policy
|
|
159
160
|
* Arguments: () =\> TrustedTypePolicy
|
|
160
161
|
*/
|
|
161
|
-
|
|
162
|
+
getTrustedTypesPolicy = 34,
|
|
162
163
|
/**
|
|
163
164
|
* a flag when a chunk has a fetch priority
|
|
164
165
|
*/
|
|
165
|
-
|
|
166
|
+
hasFetchPriority = 35,
|
|
166
167
|
/**
|
|
167
168
|
* the chunk name of the chunk with the runtime
|
|
168
169
|
*/
|
|
169
|
-
|
|
170
|
+
chunkName = 36,
|
|
170
171
|
/**
|
|
171
172
|
* the runtime id of the current runtime
|
|
172
173
|
*/
|
|
173
|
-
|
|
174
|
+
runtimeId = 37,
|
|
174
175
|
/**
|
|
175
176
|
* the filename of the script part of the chunk
|
|
176
177
|
*/
|
|
177
|
-
|
|
178
|
+
getChunkScriptFilename = 38,
|
|
178
179
|
/**
|
|
179
180
|
* the filename of the css part of the chunk
|
|
180
181
|
*/
|
|
181
|
-
|
|
182
|
+
getChunkCssFilename = 39,
|
|
183
|
+
/**
|
|
184
|
+
* rspack version
|
|
185
|
+
* @internal
|
|
186
|
+
*/
|
|
187
|
+
rspackVersion = 40,
|
|
182
188
|
/**
|
|
183
189
|
* a flag when a module/chunk/tree has css modules
|
|
184
190
|
*/
|
|
185
|
-
|
|
191
|
+
hasCssModules = 41,
|
|
192
|
+
/**
|
|
193
|
+
* rspack unique id
|
|
194
|
+
* @internal
|
|
195
|
+
*/
|
|
196
|
+
rspackUniqueId = 42,
|
|
186
197
|
/**
|
|
187
198
|
* the filename of the script part of the hot update chunk
|
|
188
199
|
*/
|
|
189
|
-
|
|
200
|
+
getChunkUpdateScriptFilename = 43,
|
|
190
201
|
/**
|
|
191
202
|
* the filename of the css part of the hot update chunk
|
|
192
203
|
*/
|
|
193
|
-
|
|
204
|
+
getChunkUpdateCssFilename = 44,
|
|
194
205
|
/**
|
|
195
206
|
* startup signal from runtime
|
|
196
207
|
* This will be called when the runtime chunk has been loaded.
|
|
197
208
|
*/
|
|
198
|
-
|
|
209
|
+
startup = 45,
|
|
199
210
|
/**
|
|
200
211
|
* @deprecated
|
|
201
212
|
* creating a default startup function with the entry modules
|
|
202
213
|
*/
|
|
203
|
-
|
|
214
|
+
startupNoDefault = 46,
|
|
204
215
|
/**
|
|
205
216
|
* startup signal from runtime but only used to add logic after the startup
|
|
206
217
|
*/
|
|
207
|
-
|
|
218
|
+
startupOnlyAfter = 47,
|
|
208
219
|
/**
|
|
209
220
|
* startup signal from runtime but only used to add sync logic before the startup
|
|
210
221
|
*/
|
|
211
|
-
|
|
222
|
+
startupOnlyBefore = 48,
|
|
212
223
|
/**
|
|
213
224
|
* global callback functions for installing chunks
|
|
214
225
|
*/
|
|
215
|
-
|
|
226
|
+
chunkCallback = 49,
|
|
216
227
|
/**
|
|
217
228
|
* method to startup an entrypoint with needed chunks.
|
|
218
229
|
* Signature: (moduleId: Id, chunkIds: Id[]) =\> any.
|
|
219
230
|
* Returns the exports of the module or a Promise
|
|
220
231
|
*/
|
|
221
|
-
|
|
232
|
+
startupEntrypoint = 50,
|
|
233
|
+
/**
|
|
234
|
+
* startup signal from runtime for chunk dependencies
|
|
235
|
+
*/
|
|
236
|
+
startupChunkDependencies = 51,
|
|
222
237
|
/**
|
|
223
238
|
* register deferred code, which will run when certain
|
|
224
239
|
* chunks are loaded.
|
|
@@ -227,87 +242,87 @@ export declare const RuntimeGlobals: {
|
|
|
227
242
|
* When (priority & 1) it will wait for all other handlers with lower priority to
|
|
228
243
|
* be executed before itself is executed
|
|
229
244
|
*/
|
|
230
|
-
|
|
245
|
+
onChunksLoaded = 52,
|
|
231
246
|
/**
|
|
232
247
|
* method to install a chunk that was loaded somehow
|
|
233
248
|
* Signature: (\{ id, ids, modules, runtime \}) =\> void
|
|
234
249
|
*/
|
|
235
|
-
|
|
250
|
+
externalInstallChunk = 53,
|
|
236
251
|
/**
|
|
237
252
|
* interceptor for module executions
|
|
238
253
|
*/
|
|
239
|
-
|
|
254
|
+
interceptModuleExecution = 54,
|
|
240
255
|
/**
|
|
241
256
|
* the global object
|
|
242
257
|
*/
|
|
243
|
-
|
|
258
|
+
global = 55,
|
|
244
259
|
/**
|
|
245
260
|
* an object with all share scopes
|
|
246
261
|
*/
|
|
247
|
-
|
|
262
|
+
shareScopeMap = 56,
|
|
248
263
|
/**
|
|
249
264
|
* The sharing init sequence function (only runs once per share scope).
|
|
250
265
|
* Has one argument, the name of the share scope.
|
|
251
266
|
* Creates a share scope if not existing
|
|
252
267
|
*/
|
|
253
|
-
|
|
268
|
+
initializeSharing = 57,
|
|
254
269
|
/**
|
|
255
270
|
* The current scope when getting a module from a remote
|
|
256
271
|
*/
|
|
257
|
-
|
|
272
|
+
currentRemoteGetScope = 58,
|
|
258
273
|
/**
|
|
259
274
|
* the filename of the HMR manifest
|
|
260
275
|
*/
|
|
261
|
-
|
|
276
|
+
getUpdateManifestFilename = 59,
|
|
262
277
|
/**
|
|
263
278
|
* function downloading the update manifest
|
|
264
279
|
*/
|
|
265
|
-
|
|
280
|
+
hmrDownloadManifest = 60,
|
|
266
281
|
/**
|
|
267
282
|
* array with handler functions to download chunk updates
|
|
268
283
|
*/
|
|
269
|
-
|
|
284
|
+
hmrDownloadUpdateHandlers = 61,
|
|
270
285
|
/**
|
|
271
286
|
* object with all hmr module data for all modules
|
|
272
287
|
*/
|
|
273
|
-
|
|
288
|
+
hmrModuleData = 62,
|
|
274
289
|
/**
|
|
275
290
|
* array with handler functions when a module should be invalidated
|
|
276
291
|
*/
|
|
277
|
-
|
|
292
|
+
hmrInvalidateModuleHandlers = 63,
|
|
278
293
|
/**
|
|
279
294
|
* the prefix for storing state of runtime modules when hmr is enabled
|
|
280
295
|
*/
|
|
281
|
-
|
|
296
|
+
hmrRuntimeStatePrefix = 64,
|
|
282
297
|
/**
|
|
283
298
|
* the AMD define function
|
|
284
299
|
*/
|
|
285
|
-
|
|
300
|
+
amdDefine = 65,
|
|
286
301
|
/**
|
|
287
302
|
* the AMD options
|
|
288
303
|
*/
|
|
289
|
-
|
|
304
|
+
amdOptions = 66,
|
|
290
305
|
/**
|
|
291
306
|
* the System polyfill object
|
|
292
307
|
*/
|
|
293
|
-
|
|
308
|
+
system = 67,
|
|
294
309
|
/**
|
|
295
310
|
* the shorthand for Object.prototype.hasOwnProperty
|
|
296
311
|
* using of it decreases the compiled bundle size
|
|
297
312
|
*/
|
|
298
|
-
|
|
313
|
+
hasOwnProperty = 68,
|
|
299
314
|
/**
|
|
300
315
|
* the System.register context object
|
|
301
316
|
*/
|
|
302
|
-
|
|
317
|
+
systemContext = 69,
|
|
303
318
|
/**
|
|
304
319
|
* the baseURI of current document
|
|
305
320
|
*/
|
|
306
|
-
|
|
321
|
+
baseURI = 70,
|
|
307
322
|
/**
|
|
308
323
|
* a RelativeURL class when relative URLs are used
|
|
309
324
|
*/
|
|
310
|
-
|
|
325
|
+
relativeUrl = 71,
|
|
311
326
|
/**
|
|
312
327
|
* Creates an async module. The body function must be a async function.
|
|
313
328
|
* "module.exports" will be decorated with an AsyncModulePromise.
|
|
@@ -320,9 +335,22 @@ export declare const RuntimeGlobals: {
|
|
|
320
335
|
* hasAwaitAfterDependencies?: boolean
|
|
321
336
|
* ) =\> void
|
|
322
337
|
*/
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
export declare const isReservedRuntimeGlobal: (r: string) => boolean;
|
|
338
|
+
asyncModule = 72,
|
|
339
|
+
asyncModuleExportSymbol = 73,
|
|
340
|
+
makeDeferredNamespaceObject = 74,
|
|
341
|
+
makeDeferredNamespaceObjectSymbol = 75
|
|
342
|
+
}
|
|
343
|
+
export declare const isReservedRuntimeGlobal: (r: string, compilerRuntimeGlobals: Record<string, string>) => boolean;
|
|
344
|
+
export declare function renderModulePrefix(_compilerOptions: RspackOptionsNormalized): string;
|
|
345
|
+
export declare enum RuntimeVariable {
|
|
346
|
+
Require = 0,
|
|
347
|
+
Modules = 1,
|
|
348
|
+
ModuleCache = 2,
|
|
349
|
+
Module = 3,
|
|
350
|
+
Exports = 4,
|
|
351
|
+
StartupExec = 5
|
|
352
|
+
}
|
|
353
|
+
export declare function renderRuntimeVariables(variable: RuntimeVariable, _compilerOptions?: RspackOptionsNormalized): string;
|
|
354
|
+
export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): typeof RuntimeGlobals;
|
|
355
|
+
declare const DefaultRuntimeGlobals: typeof RuntimeGlobals;
|
|
356
|
+
export { DefaultRuntimeGlobals as RuntimeGlobals };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { LoaderContext, LoaderDefinition } from "../..";
|
|
2
|
-
export declare const BASE_URI = "
|
|
2
|
+
export declare const BASE_URI = "rspack-css-extract://";
|
|
3
3
|
export declare const MODULE_TYPE = "css/mini-extract";
|
|
4
|
-
export declare const AUTO_PUBLIC_PATH = "
|
|
5
|
-
export declare const ABSOLUTE_PUBLIC_PATH = "
|
|
6
|
-
export declare const SINGLE_DOT_PATH_SEGMENT = "
|
|
4
|
+
export declare const AUTO_PUBLIC_PATH = "__css_extract_public_path_auto__";
|
|
5
|
+
export declare const ABSOLUTE_PUBLIC_PATH = "rspack-css-extract:///css-extract-plugin/";
|
|
6
|
+
export declare const SINGLE_DOT_PATH_SEGMENT = "__css_extract_single_dot_path_segment__";
|
|
7
7
|
export interface CssExtractRspackLoaderOptions {
|
|
8
8
|
publicPath?: string | ((resourcePath: string, context: string) => string);
|
|
9
9
|
emit?: boolean;
|