@rspack/browser 1.6.8 → 1.7.0-beta.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.
- package/dist/Compilation.d.ts +24 -4
- package/dist/Resolver.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +2 -2
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +8 -0
- package/dist/config/normalization.d.ts +10 -1
- package/dist/config/types.d.ts +23 -3
- package/dist/exports.d.ts +9 -1
- package/dist/index.mjs +130 -74
- package/dist/lib/EntryOptionPlugin.d.ts +1 -1
- package/dist/napi-binding.d.ts +2 -8
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/util/fake.d.ts +6 -1
- package/package.json +2 -2
package/dist/Compilation.d.ts
CHANGED
|
@@ -289,9 +289,14 @@ export declare class Compilation {
|
|
|
289
289
|
getLogger(name: string | (() => string)): Logger;
|
|
290
290
|
fileDependencies: {
|
|
291
291
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
292
|
-
has(dep: string)
|
|
292
|
+
has: (dep: string) => boolean;
|
|
293
293
|
add: (dep: string) => void;
|
|
294
294
|
addAll: (deps: Iterable<string>) => void;
|
|
295
|
+
delete: (dep: string) => boolean;
|
|
296
|
+
keys(): SetIterator<string>;
|
|
297
|
+
values(): SetIterator<string>;
|
|
298
|
+
entries(): SetIterator<[string, string]>;
|
|
299
|
+
readonly size: number;
|
|
295
300
|
};
|
|
296
301
|
get __internal__addedFileDependencies(): string[];
|
|
297
302
|
get __internal__removedFileDependencies(): string[];
|
|
@@ -301,21 +306,36 @@ export declare class Compilation {
|
|
|
301
306
|
get __internal__removedMissingDependencies(): string[];
|
|
302
307
|
contextDependencies: {
|
|
303
308
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
304
|
-
has(dep: string)
|
|
309
|
+
has: (dep: string) => boolean;
|
|
305
310
|
add: (dep: string) => void;
|
|
306
311
|
addAll: (deps: Iterable<string>) => void;
|
|
312
|
+
delete: (dep: string) => boolean;
|
|
313
|
+
keys(): SetIterator<string>;
|
|
314
|
+
values(): SetIterator<string>;
|
|
315
|
+
entries(): SetIterator<[string, string]>;
|
|
316
|
+
readonly size: number;
|
|
307
317
|
};
|
|
308
318
|
missingDependencies: {
|
|
309
319
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
310
|
-
has(dep: string)
|
|
320
|
+
has: (dep: string) => boolean;
|
|
311
321
|
add: (dep: string) => void;
|
|
312
322
|
addAll: (deps: Iterable<string>) => void;
|
|
323
|
+
delete: (dep: string) => boolean;
|
|
324
|
+
keys(): SetIterator<string>;
|
|
325
|
+
values(): SetIterator<string>;
|
|
326
|
+
entries(): SetIterator<[string, string]>;
|
|
327
|
+
readonly size: number;
|
|
313
328
|
};
|
|
314
329
|
buildDependencies: {
|
|
315
330
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
316
|
-
has(dep: string)
|
|
331
|
+
has: (dep: string) => boolean;
|
|
317
332
|
add: (dep: string) => void;
|
|
318
333
|
addAll: (deps: Iterable<string>) => void;
|
|
334
|
+
delete: (dep: string) => boolean;
|
|
335
|
+
keys(): SetIterator<string>;
|
|
336
|
+
values(): SetIterator<string>;
|
|
337
|
+
entries(): SetIterator<[string, string]>;
|
|
338
|
+
readonly size: number;
|
|
319
339
|
};
|
|
320
340
|
getStats(): Stats;
|
|
321
341
|
createChildCompiler(name: string, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
|
package/dist/Resolver.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ export interface ResolveRequest {
|
|
|
25
25
|
export declare class Resolver {
|
|
26
26
|
#private;
|
|
27
27
|
constructor(binding: binding.JsResolver);
|
|
28
|
-
resolveSync(
|
|
29
|
-
resolve(
|
|
28
|
+
resolveSync(_context: object, path: string, request: string): string | false;
|
|
29
|
+
resolve(_context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void;
|
|
30
30
|
}
|
package/dist/RuntimeGlobals.d.ts
CHANGED
|
@@ -351,6 +351,6 @@ export declare enum RuntimeVariable {
|
|
|
351
351
|
StartupExec = 5
|
|
352
352
|
}
|
|
353
353
|
export declare function renderRuntimeVariables(variable: RuntimeVariable, _compilerOptions?: RspackOptionsNormalized): string;
|
|
354
|
-
export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): typeof RuntimeGlobals
|
|
355
|
-
declare const DefaultRuntimeGlobals:
|
|
354
|
+
export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): Record<keyof typeof RuntimeGlobals, string>;
|
|
355
|
+
declare const DefaultRuntimeGlobals: Record<"publicPath" | "chunkName" | "moduleId" | "module" | "exports" | "require" | "global" | "system" | "requireScope" | "thisAsExports" | "returnExportsFromRuntime" | "moduleLoaded" | "entryModuleId" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "definePropertyGetters" | "makeNamespaceObject" | "createFakeNamespaceObject" | "compatGetDefaultExport" | "harmonyModuleDecorator" | "nodeModuleDecorator" | "getFullHash" | "wasmInstances" | "instantiateWasm" | "uncaughtErrorHandler" | "scriptNonce" | "loadScript" | "createScript" | "createScriptUrl" | "getTrustedTypesPolicy" | "hasFetchPriority" | "runtimeId" | "getChunkScriptFilename" | "getChunkCssFilename" | "rspackVersion" | "hasCssModules" | "rspackUniqueId" | "getChunkUpdateScriptFilename" | "getChunkUpdateCssFilename" | "startup" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "chunkCallback" | "startupEntrypoint" | "startupChunkDependencies" | "onChunksLoaded" | "externalInstallChunk" | "interceptModuleExecution" | "shareScopeMap" | "initializeSharing" | "currentRemoteGetScope" | "getUpdateManifestFilename" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrModuleData" | "hmrInvalidateModuleHandlers" | "hmrRuntimeStatePrefix" | "amdDefine" | "amdOptions" | "hasOwnProperty" | "systemContext" | "baseURI" | "relativeUrl" | "asyncModule" | "asyncModuleExportSymbol" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol", string>;
|
|
356
356
|
export { DefaultRuntimeGlobals as RuntimeGlobals };
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { type Compiler, MultiCompiler } from "../..";
|
|
2
2
|
import type { MiddlewareHandler } from "../../config/devServer";
|
|
3
3
|
export declare const LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-";
|
|
4
|
+
/**
|
|
5
|
+
* Create a middleware that handles lazy compilation requests from the client.
|
|
6
|
+
* This function returns an Express-style middleware that listens for
|
|
7
|
+
* requests triggered by lazy compilation in the dev server client,
|
|
8
|
+
* then invokes the Rspack compiler to compile modules on demand.
|
|
9
|
+
* Use this middleware when integrating lazy compilation into a
|
|
10
|
+
* custom development server instead of relying on the built-in server.
|
|
11
|
+
*/
|
|
4
12
|
export declare const lazyCompilationMiddleware: (compiler: Compiler | MultiCompiler) => MiddlewareHandler;
|
|
@@ -17,7 +17,7 @@ export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
|
|
|
17
17
|
export interface EntryStaticNormalized {
|
|
18
18
|
[k: string]: EntryDescriptionNormalized;
|
|
19
19
|
}
|
|
20
|
-
export type EntryDescriptionNormalized = Pick<EntryDescription, "runtime" | "chunkLoading" | "asyncChunks" | "publicPath" | "baseUri" | "filename" | "library" | "layer"> & {
|
|
20
|
+
export type EntryDescriptionNormalized = Pick<EntryDescription, "runtime" | "chunkLoading" | "wasmLoading" | "asyncChunks" | "publicPath" | "baseUri" | "filename" | "library" | "layer"> & {
|
|
21
21
|
import?: string[];
|
|
22
22
|
dependOn?: string[];
|
|
23
23
|
};
|
|
@@ -120,9 +120,18 @@ export interface ExperimentsNormalized {
|
|
|
120
120
|
buildHttp?: HttpUriPluginOptions;
|
|
121
121
|
parallelLoader?: boolean;
|
|
122
122
|
useInputFileSystem?: false | RegExp[];
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
125
|
+
*/
|
|
123
126
|
inlineConst?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
129
|
+
*/
|
|
124
130
|
inlineEnum?: boolean;
|
|
125
131
|
typeReexportsPresence?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
134
|
+
*/
|
|
126
135
|
lazyBarrel?: boolean;
|
|
127
136
|
nativeWatcher?: boolean;
|
|
128
137
|
deferImport?: boolean;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -858,8 +858,6 @@ export type JavascriptParserOptions = {
|
|
|
858
858
|
* Enable magic comments for CommonJS require() expressions.
|
|
859
859
|
*/
|
|
860
860
|
commonjsMagicComments?: boolean;
|
|
861
|
-
/** Inline const values in this module */
|
|
862
|
-
inlineConst?: boolean;
|
|
863
861
|
/** Whether to tolerant exportsPresence for type reexport */
|
|
864
862
|
typeReexportsPresence?: "no-tolerant" | "tolerant" | "tolerant-no-check";
|
|
865
863
|
/** Whether to enable JSX parsing */
|
|
@@ -1881,6 +1879,13 @@ export type Optimization = {
|
|
|
1881
1879
|
* The value is `false` in development mode.
|
|
1882
1880
|
*/
|
|
1883
1881
|
mangleExports?: "size" | "deterministic" | boolean;
|
|
1882
|
+
/**
|
|
1883
|
+
* Allows to inline exports when possible to reduce code size.
|
|
1884
|
+
*
|
|
1885
|
+
* The value is `true` in production mode.
|
|
1886
|
+
* The value is `false` in development mode.
|
|
1887
|
+
*/
|
|
1888
|
+
inlineExports?: boolean;
|
|
1884
1889
|
/**
|
|
1885
1890
|
* Tells Rspack to set process.env.NODE_ENV to a given string value.
|
|
1886
1891
|
* @default false
|
|
@@ -2155,21 +2160,25 @@ export type Experiments = {
|
|
|
2155
2160
|
/**
|
|
2156
2161
|
* Enable inline const feature
|
|
2157
2162
|
* @default false
|
|
2163
|
+
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
2158
2164
|
*/
|
|
2159
2165
|
inlineConst?: boolean;
|
|
2160
2166
|
/**
|
|
2161
2167
|
* Enable inline enum feature
|
|
2162
2168
|
* @default false
|
|
2169
|
+
* @deprecated This option is deprecated, it's already stable. Rspack will remove this option in future version
|
|
2163
2170
|
*/
|
|
2164
2171
|
inlineEnum?: boolean;
|
|
2165
2172
|
/**
|
|
2166
2173
|
* Enable type reexports presence feature
|
|
2167
2174
|
* @default false
|
|
2175
|
+
* @deprecated This option is deprecated, it's already stable. Rspack will remove this option in future version
|
|
2168
2176
|
*/
|
|
2169
2177
|
typeReexportsPresence?: boolean;
|
|
2170
2178
|
/**
|
|
2171
2179
|
* Enable lazy make side effects free barrel file
|
|
2172
2180
|
* @default false
|
|
2181
|
+
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
2173
2182
|
*/
|
|
2174
2183
|
lazyBarrel?: boolean;
|
|
2175
2184
|
/**
|
|
@@ -2333,7 +2342,18 @@ export type RspackOptions = {
|
|
|
2333
2342
|
*/
|
|
2334
2343
|
loader?: Loader;
|
|
2335
2344
|
/**
|
|
2336
|
-
*
|
|
2345
|
+
* Tells Rspack to suppress specific compilation warnings by matching their
|
|
2346
|
+
* message, module, or file, or by using a custom function.
|
|
2347
|
+
*
|
|
2348
|
+
* @example
|
|
2349
|
+
* ```js
|
|
2350
|
+
* export default {
|
|
2351
|
+
* ignoreWarnings: [
|
|
2352
|
+
* /warning from compiler/,
|
|
2353
|
+
* { file: /node_modules/ },
|
|
2354
|
+
* ],
|
|
2355
|
+
* };
|
|
2356
|
+
* ```
|
|
2337
2357
|
*/
|
|
2338
2358
|
ignoreWarnings?: IgnoreWarnings;
|
|
2339
2359
|
/**
|
package/dist/exports.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export { LoaderOptionsPlugin } from "./lib/LoaderOptionsPlugin";
|
|
|
56
56
|
export { LoaderTargetPlugin } from "./lib/LoaderTargetPlugin";
|
|
57
57
|
export type { OutputFileSystem, WatchFileSystem } from "./util/fs";
|
|
58
58
|
import { EsmLibraryPlugin, FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, SubresourceIntegrityPlugin } from "./builtin-plugin";
|
|
59
|
+
export { SubresourceIntegrityPlugin };
|
|
59
60
|
interface Web {
|
|
60
61
|
FetchCompileAsyncWasmPlugin: typeof FetchCompileAsyncWasmPlugin;
|
|
61
62
|
}
|
|
@@ -68,6 +69,7 @@ interface Node {
|
|
|
68
69
|
NodeTemplatePlugin: typeof NodeTemplatePlugin;
|
|
69
70
|
NodeEnvironmentPlugin: typeof NodeEnvironmentPlugin;
|
|
70
71
|
}
|
|
72
|
+
export { lazyCompilationMiddleware };
|
|
71
73
|
export declare const node: Node;
|
|
72
74
|
import { ElectronTargetPlugin } from "./builtin-plugin";
|
|
73
75
|
interface Electron {
|
|
@@ -141,11 +143,17 @@ interface Experiments {
|
|
|
141
143
|
cleanup: () => Promise<void>;
|
|
142
144
|
};
|
|
143
145
|
RemoveDuplicateModulesPlugin: typeof RemoveDuplicateModulesPlugin;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated Use `rspack.SubresourceIntegrityPlugin` instead
|
|
148
|
+
*/
|
|
149
|
+
SubresourceIntegrityPlugin: typeof SubresourceIntegrityPlugin;
|
|
144
150
|
EsmLibraryPlugin: typeof EsmLibraryPlugin;
|
|
145
151
|
RsdoctorPlugin: typeof RsdoctorPlugin;
|
|
146
152
|
RstestPlugin: typeof RstestPlugin;
|
|
147
153
|
RslibPlugin: typeof RslibPlugin;
|
|
148
|
-
|
|
154
|
+
/**
|
|
155
|
+
* @deprecated Use `rspack.lazyCompilationMiddleware` instead
|
|
156
|
+
*/
|
|
149
157
|
lazyCompilationMiddleware: typeof lazyCompilationMiddleware;
|
|
150
158
|
swc: {
|
|
151
159
|
transform: typeof transform;
|
package/dist/index.mjs
CHANGED
|
@@ -50605,6 +50605,7 @@ __webpack_require__.d(exports_namespaceObject, {
|
|
|
50605
50605
|
SourceMapDevToolPlugin: ()=>SourceMapDevToolPlugin,
|
|
50606
50606
|
Stats: ()=>Stats,
|
|
50607
50607
|
StatsErrorCode: ()=>statsFactoryUtils_StatsErrorCode,
|
|
50608
|
+
SubresourceIntegrityPlugin: ()=>SubresourceIntegrityPlugin,
|
|
50608
50609
|
SwcJsMinimizerRspackPlugin: ()=>SwcJsMinimizerRspackPlugin,
|
|
50609
50610
|
Template: ()=>Template,
|
|
50610
50611
|
ValidationError: ()=>ValidationError,
|
|
@@ -50616,6 +50617,7 @@ __webpack_require__.d(exports_namespaceObject, {
|
|
|
50616
50617
|
electron: ()=>electron,
|
|
50617
50618
|
experiments: ()=>exports_experiments,
|
|
50618
50619
|
javascript: ()=>javascript,
|
|
50620
|
+
lazyCompilationMiddleware: ()=>lazyCompilationMiddleware,
|
|
50619
50621
|
library: ()=>exports_library,
|
|
50620
50622
|
node: ()=>exports_node,
|
|
50621
50623
|
optimize: ()=>optimize,
|
|
@@ -51805,22 +51807,49 @@ class MergeCaller {
|
|
|
51805
51807
|
}
|
|
51806
51808
|
function createFakeCompilationDependencies(getDeps, addDeps) {
|
|
51807
51809
|
const addDepsCaller = new MergeCaller(addDeps);
|
|
51810
|
+
const deletedDeps = new Set();
|
|
51811
|
+
const hasDep = (dep)=>{
|
|
51812
|
+
if (deletedDeps.has(dep)) return false;
|
|
51813
|
+
return addDepsCaller.pendingData().includes(dep) || getDeps().includes(dep);
|
|
51814
|
+
};
|
|
51815
|
+
const getAllDeps = ()=>{
|
|
51816
|
+
const deps = new Set([
|
|
51817
|
+
...getDeps(),
|
|
51818
|
+
...addDepsCaller.pendingData()
|
|
51819
|
+
]);
|
|
51820
|
+
for (const deleted of deletedDeps)deps.delete(deleted);
|
|
51821
|
+
return deps;
|
|
51822
|
+
};
|
|
51808
51823
|
return {
|
|
51809
51824
|
*[Symbol.iterator] () {
|
|
51810
|
-
const deps =
|
|
51811
|
-
...getDeps(),
|
|
51812
|
-
...addDepsCaller.pendingData()
|
|
51813
|
-
]);
|
|
51825
|
+
const deps = getAllDeps();
|
|
51814
51826
|
for (const dep of deps)yield dep;
|
|
51815
51827
|
},
|
|
51816
|
-
has
|
|
51817
|
-
return addDepsCaller.pendingData().includes(dep) || getDeps().includes(dep);
|
|
51818
|
-
},
|
|
51828
|
+
has: hasDep,
|
|
51819
51829
|
add: (dep)=>{
|
|
51830
|
+
deletedDeps.delete(dep);
|
|
51820
51831
|
addDepsCaller.push(dep);
|
|
51821
51832
|
},
|
|
51822
51833
|
addAll: (deps)=>{
|
|
51834
|
+
for (const dep of deps)deletedDeps.delete(dep);
|
|
51823
51835
|
addDepsCaller.push(...deps);
|
|
51836
|
+
},
|
|
51837
|
+
delete: (dep)=>{
|
|
51838
|
+
const hadDep = hasDep(dep);
|
|
51839
|
+
if (hadDep) deletedDeps.add(dep);
|
|
51840
|
+
return hadDep;
|
|
51841
|
+
},
|
|
51842
|
+
keys () {
|
|
51843
|
+
return getAllDeps().keys();
|
|
51844
|
+
},
|
|
51845
|
+
values () {
|
|
51846
|
+
return getAllDeps().values();
|
|
51847
|
+
},
|
|
51848
|
+
entries () {
|
|
51849
|
+
return getAllDeps().entries();
|
|
51850
|
+
},
|
|
51851
|
+
get size () {
|
|
51852
|
+
return getAllDeps().size;
|
|
51824
51853
|
}
|
|
51825
51854
|
};
|
|
51826
51855
|
}
|
|
@@ -52594,7 +52623,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
52594
52623
|
processAssetsHook.tap(getOptions(options), ()=>fn(...getArgs()));
|
|
52595
52624
|
},
|
|
52596
52625
|
tapAsync: (options, fn)=>{
|
|
52597
|
-
processAssetsHook.tapAsync(getOptions(options), (
|
|
52626
|
+
processAssetsHook.tapAsync(getOptions(options), (_assets, callback)=>fn(...getArgs(), callback));
|
|
52598
52627
|
},
|
|
52599
52628
|
tapPromise: (options, fn)=>{
|
|
52600
52629
|
processAssetsHook.tapPromise(getOptions(options), ()=>fn(...getArgs()));
|
|
@@ -53219,7 +53248,7 @@ class EntryOptionPlugin {
|
|
|
53219
53248
|
for (const entry of desc.import)new EntryPlugin(context, entry, options).apply(compiler);
|
|
53220
53249
|
}
|
|
53221
53250
|
}
|
|
53222
|
-
static entryDescriptionToOptions(
|
|
53251
|
+
static entryDescriptionToOptions(_compiler, name, desc) {
|
|
53223
53252
|
const options = {
|
|
53224
53253
|
name,
|
|
53225
53254
|
filename: desc.filename,
|
|
@@ -53249,14 +53278,13 @@ const OriginEntryPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPl
|
|
|
53249
53278
|
const EntryPlugin = OriginEntryPlugin;
|
|
53250
53279
|
EntryPlugin.createDependency = (request)=>new external_rspack_wasi_browser_js_.EntryDependency(request);
|
|
53251
53280
|
function getRawEntryOptions(entry) {
|
|
53252
|
-
const runtime = entry.runtime;
|
|
53253
|
-
const chunkLoading = entry.chunkLoading;
|
|
53254
53281
|
return {
|
|
53255
53282
|
name: entry.name,
|
|
53256
53283
|
publicPath: entry.publicPath,
|
|
53257
53284
|
baseUri: entry.baseUri,
|
|
53258
|
-
runtime,
|
|
53259
|
-
chunkLoading,
|
|
53285
|
+
runtime: entry.runtime,
|
|
53286
|
+
chunkLoading: entry.chunkLoading,
|
|
53287
|
+
wasmLoading: entry.wasmLoading,
|
|
53260
53288
|
asyncChunks: entry.asyncChunks,
|
|
53261
53289
|
filename: entry.filename,
|
|
53262
53290
|
library: entry.library,
|
|
@@ -53389,6 +53417,7 @@ function EsmLibraryPlugin_define_property(obj, key, value) {
|
|
|
53389
53417
|
}
|
|
53390
53418
|
function applyLimits(options, logger) {
|
|
53391
53419
|
options.optimization.concatenateModules = false;
|
|
53420
|
+
options.optimization.removeEmptyChunks = false;
|
|
53392
53421
|
options.output.chunkFormat = false;
|
|
53393
53422
|
if (options.output.chunkLoading && "import" !== options.output.chunkLoading) {
|
|
53394
53423
|
logger.warn(`\`output.chunkLoading\` should be \`"import"\` or \`false\`, but got ${options.output.chunkLoading}, changed it to \`"import"\``);
|
|
@@ -55557,13 +55586,13 @@ function getRawParserOptionsMap(parser) {
|
|
|
55557
55586
|
return Object.fromEntries(Object.entries(parser).map(([k, v])=>[
|
|
55558
55587
|
k,
|
|
55559
55588
|
getRawParserOptions(v, k)
|
|
55560
|
-
]).filter(([
|
|
55589
|
+
]).filter(([_, v])=>void 0 !== v));
|
|
55561
55590
|
}
|
|
55562
55591
|
function getRawGeneratorOptionsMap(generator) {
|
|
55563
55592
|
return Object.fromEntries(Object.entries(generator).map(([k, v])=>[
|
|
55564
55593
|
k,
|
|
55565
55594
|
getRawGeneratorOptions(v, k)
|
|
55566
|
-
]).filter(([
|
|
55595
|
+
]).filter(([_, v])=>void 0 !== v));
|
|
55567
55596
|
}
|
|
55568
55597
|
function getRawParserOptions(parser, type) {
|
|
55569
55598
|
if ("asset" === type) return {
|
|
@@ -55630,7 +55659,6 @@ function getRawJavascriptParserOptions(parser) {
|
|
|
55630
55659
|
commonjs: parser.commonjs,
|
|
55631
55660
|
importDynamic: parser.importDynamic,
|
|
55632
55661
|
commonjsMagicComments: parser.commonjsMagicComments,
|
|
55633
|
-
inlineConst: parser.inlineConst,
|
|
55634
55662
|
typeReexportsPresence: parser.typeReexportsPresence,
|
|
55635
55663
|
jsx: parser.jsx,
|
|
55636
55664
|
deferImport: parser.deferImport
|
|
@@ -58075,7 +58103,13 @@ const applyRspackOptionsDefaults = (options)=>{
|
|
|
58075
58103
|
F(options, "devtool", ()=>development ? "eval" : false);
|
|
58076
58104
|
D(options, "watch", false);
|
|
58077
58105
|
D(options, "profile", false);
|
|
58078
|
-
|
|
58106
|
+
F(options, "lazyCompilation", ()=>{
|
|
58107
|
+
if (!!targetProperties && targetProperties.web && !targetProperties.electron && !targetProperties.node && !targetProperties.nwjs) return {
|
|
58108
|
+
imports: true,
|
|
58109
|
+
entries: false
|
|
58110
|
+
};
|
|
58111
|
+
return false;
|
|
58112
|
+
});
|
|
58079
58113
|
D(options, "bail", false);
|
|
58080
58114
|
F(options, "cache", ()=>development);
|
|
58081
58115
|
if (false === options.cache) options.experiments.cache = false;
|
|
@@ -58085,7 +58119,8 @@ const applyRspackOptionsDefaults = (options)=>{
|
|
|
58085
58119
|
applyOptimizationDefaults(options.optimization, {
|
|
58086
58120
|
production,
|
|
58087
58121
|
development,
|
|
58088
|
-
css: options.experiments.css
|
|
58122
|
+
css: options.experiments.css,
|
|
58123
|
+
deprecatedInline: options.experiments.inlineConst || options.experiments.inlineEnum
|
|
58089
58124
|
});
|
|
58090
58125
|
applySnapshotDefaults(options.snapshot, {
|
|
58091
58126
|
production
|
|
@@ -58097,8 +58132,6 @@ const applyRspackOptionsDefaults = (options)=>{
|
|
|
58097
58132
|
targetProperties,
|
|
58098
58133
|
mode: options.mode,
|
|
58099
58134
|
uniqueName: options.output.uniqueName,
|
|
58100
|
-
usedExports: !!options.optimization.usedExports,
|
|
58101
|
-
inlineConst: options.experiments.inlineConst,
|
|
58102
58135
|
deferImport: options.experiments.deferImport
|
|
58103
58136
|
});
|
|
58104
58137
|
applyOutputDefaults(options.output, {
|
|
@@ -58106,9 +58139,7 @@ const applyRspackOptionsDefaults = (options)=>{
|
|
|
58106
58139
|
targetProperties,
|
|
58107
58140
|
isAffectedByBrowserslist: void 0 === target || "string" == typeof target && target.startsWith("browserslist") || Array.isArray(target) && target.some((target)=>target.startsWith("browserslist")),
|
|
58108
58141
|
outputModule: options.experiments.outputModule,
|
|
58109
|
-
|
|
58110
|
-
entry: options.entry,
|
|
58111
|
-
futureDefaults: options.experiments.futureDefaults
|
|
58142
|
+
entry: options.entry
|
|
58112
58143
|
});
|
|
58113
58144
|
applybundlerInfoDefaults(options.experiments.rspackFuture, options.output.library);
|
|
58114
58145
|
applyExternalsPresetsDefaults(options.externalsPresets, {
|
|
@@ -58181,7 +58212,7 @@ const applyExperimentsDefaults = (experiments, { development })=>{
|
|
|
58181
58212
|
D(experiments, "parallelCodeSplitting", false);
|
|
58182
58213
|
D(experiments, "parallelLoader", false);
|
|
58183
58214
|
D(experiments, "useInputFileSystem", false);
|
|
58184
|
-
D(experiments, "inlineConst",
|
|
58215
|
+
D(experiments, "inlineConst", true);
|
|
58185
58216
|
D(experiments, "inlineEnum", false);
|
|
58186
58217
|
D(experiments, "typeReexportsPresence", false);
|
|
58187
58218
|
D(experiments, "lazyBarrel", true);
|
|
@@ -58190,14 +58221,14 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
|
|
|
58190
58221
|
if ("object" == typeof rspackFuture) {
|
|
58191
58222
|
D(rspackFuture, "bundlerInfo", {});
|
|
58192
58223
|
if ("object" == typeof rspackFuture.bundlerInfo) {
|
|
58193
|
-
D(rspackFuture.bundlerInfo, "version", "1.
|
|
58224
|
+
D(rspackFuture.bundlerInfo, "version", "1.7.0-beta.0");
|
|
58194
58225
|
D(rspackFuture.bundlerInfo, "bundler", "rspack");
|
|
58195
58226
|
D(rspackFuture.bundlerInfo, "force", !library);
|
|
58196
58227
|
}
|
|
58197
58228
|
}
|
|
58198
58229
|
};
|
|
58199
58230
|
const applySnapshotDefaults = (_snapshot, _env)=>{};
|
|
58200
|
-
const applyJavascriptParserOptionsDefaults = (parserOptions, {
|
|
58231
|
+
const applyJavascriptParserOptionsDefaults = (parserOptions, { deferImport })=>{
|
|
58201
58232
|
D(parserOptions, "dynamicImportMode", "lazy");
|
|
58202
58233
|
D(parserOptions, "dynamicImportPrefetch", false);
|
|
58203
58234
|
D(parserOptions, "dynamicImportPreload", false);
|
|
@@ -58216,7 +58247,6 @@ const applyJavascriptParserOptionsDefaults = (parserOptions, { usedExports, inli
|
|
|
58216
58247
|
"..."
|
|
58217
58248
|
]);
|
|
58218
58249
|
D(parserOptions, "importMeta", true);
|
|
58219
|
-
D(parserOptions, "inlineConst", usedExports && inlineConst);
|
|
58220
58250
|
D(parserOptions, "typeReexportsPresence", "no-tolerant");
|
|
58221
58251
|
D(parserOptions, "jsx", false);
|
|
58222
58252
|
D(parserOptions, "deferImport", deferImport);
|
|
@@ -58224,7 +58254,7 @@ const applyJavascriptParserOptionsDefaults = (parserOptions, { usedExports, inli
|
|
|
58224
58254
|
const applyJsonGeneratorOptionsDefaults = (generatorOptions)=>{
|
|
58225
58255
|
D(generatorOptions, "JSONParse", true);
|
|
58226
58256
|
};
|
|
58227
|
-
const applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName,
|
|
58257
|
+
const applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, deferImport })=>{
|
|
58228
58258
|
assertNotNill(module1.parser);
|
|
58229
58259
|
assertNotNill(module1.generator);
|
|
58230
58260
|
cache ? D(module1, "unsafeCache", /[\\/]node_modules[\\/]/) : D(module1, "unsafeCache", false);
|
|
@@ -58235,8 +58265,6 @@ const applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProp
|
|
|
58235
58265
|
F(module1.parser, "javascript", ()=>({}));
|
|
58236
58266
|
assertNotNill(module1.parser.javascript);
|
|
58237
58267
|
applyJavascriptParserOptionsDefaults(module1.parser.javascript, {
|
|
58238
|
-
usedExports,
|
|
58239
|
-
inlineConst,
|
|
58240
58268
|
deferImport
|
|
58241
58269
|
});
|
|
58242
58270
|
F(module1.parser, "json", ()=>({}));
|
|
@@ -58395,11 +58423,16 @@ const applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProp
|
|
|
58395
58423
|
type: "json"
|
|
58396
58424
|
},
|
|
58397
58425
|
type: "json"
|
|
58426
|
+
}, {
|
|
58427
|
+
with: {
|
|
58428
|
+
type: "text"
|
|
58429
|
+
},
|
|
58430
|
+
type: "asset/source"
|
|
58398
58431
|
});
|
|
58399
58432
|
return rules;
|
|
58400
58433
|
});
|
|
58401
58434
|
};
|
|
58402
|
-
const applyOutputDefaults = (output, { context, outputModule, targetProperties: tp, isAffectedByBrowserslist,
|
|
58435
|
+
const applyOutputDefaults = (output, { context, outputModule, targetProperties: tp, isAffectedByBrowserslist, entry })=>{
|
|
58403
58436
|
const getLibraryName = (library)=>{
|
|
58404
58437
|
const libraryName = "object" == typeof library && library && !Array.isArray(library) && "type" in library ? library.name : library;
|
|
58405
58438
|
if (Array.isArray(libraryName)) return libraryName.join(".");
|
|
@@ -58408,7 +58441,7 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
|
|
|
58408
58441
|
return "";
|
|
58409
58442
|
};
|
|
58410
58443
|
F(output, "uniqueName", ()=>{
|
|
58411
|
-
const libraryName = getLibraryName(output.library).replace(/^\[(\\*[\w:]+\\*)\](\.)|(\.)\[(\\*[\w:]+\\*)\](?=\.|$)|\[(\\*[\w:]+\\*)\]/g, (
|
|
58444
|
+
const libraryName = getLibraryName(output.library).replace(/^\[(\\*[\w:]+\\*)\](\.)|(\.)\[(\\*[\w:]+\\*)\](?=\.|$)|\[(\\*[\w:]+\\*)\]/g, (_, a, d1, d2, b, c)=>{
|
|
58412
58445
|
const content = a || b || c;
|
|
58413
58446
|
return content.startsWith("\\") && content.endsWith("\\") ? `${d2 || ""}[${content.slice(1, -1)}]${d1 || ""}` : "";
|
|
58414
58447
|
});
|
|
@@ -58544,7 +58577,7 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
|
|
|
58544
58577
|
if (tp) {
|
|
58545
58578
|
if (tp.fetchWasm) return "fetch";
|
|
58546
58579
|
if (tp.nodeBuiltins) return "async-node";
|
|
58547
|
-
null === tp.nodeBuiltins || tp.fetchWasm;
|
|
58580
|
+
if ((null === tp.nodeBuiltins || null === tp.fetchWasm) && output.module && environment.dynamicImport) return "universal";
|
|
58548
58581
|
}
|
|
58549
58582
|
return false;
|
|
58550
58583
|
});
|
|
@@ -58595,6 +58628,9 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
|
|
|
58595
58628
|
const enabledWasmLoadingTypes = new Set();
|
|
58596
58629
|
if (output.wasmLoading) enabledWasmLoadingTypes.add(output.wasmLoading);
|
|
58597
58630
|
if (output.workerWasmLoading) enabledWasmLoadingTypes.add(output.workerWasmLoading);
|
|
58631
|
+
forEachEntry((desc)=>{
|
|
58632
|
+
if (desc.wasmLoading) enabledWasmLoadingTypes.add(desc.wasmLoading);
|
|
58633
|
+
});
|
|
58598
58634
|
return Array.from(enabledWasmLoadingTypes);
|
|
58599
58635
|
});
|
|
58600
58636
|
};
|
|
@@ -58644,7 +58680,7 @@ const applyPerformanceDefaults = (performance, { production })=>{
|
|
|
58644
58680
|
D(performance, "maxEntrypointSize", 250000);
|
|
58645
58681
|
F(performance, "hints", ()=>production ? "warning" : false);
|
|
58646
58682
|
};
|
|
58647
|
-
const applyOptimizationDefaults = (optimization, { production, development, css })=>{
|
|
58683
|
+
const applyOptimizationDefaults = (optimization, { production, development, css, deprecatedInline })=>{
|
|
58648
58684
|
D(optimization, "removeAvailableModules", true);
|
|
58649
58685
|
D(optimization, "removeEmptyChunks", true);
|
|
58650
58686
|
D(optimization, "mergeDuplicateChunks", true);
|
|
@@ -58660,6 +58696,7 @@ const applyOptimizationDefaults = (optimization, { production, development, css
|
|
|
58660
58696
|
});
|
|
58661
58697
|
F(optimization, "sideEffects", ()=>production ? true : "flag");
|
|
58662
58698
|
D(optimization, "mangleExports", production);
|
|
58699
|
+
D(optimization, "inlineExports", deprecatedInline && production);
|
|
58663
58700
|
D(optimization, "providedExports", true);
|
|
58664
58701
|
D(optimization, "usedExports", production);
|
|
58665
58702
|
D(optimization, "innerGraph", production);
|
|
@@ -58876,20 +58913,24 @@ const A = (obj, prop, factory)=>{
|
|
|
58876
58913
|
};
|
|
58877
58914
|
const getPnpDefault = ()=>!!defaults_process.versions.pnp;
|
|
58878
58915
|
var normalization_process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
58916
|
+
const normalizeIgnoreWarnings = (ignoreWarnings)=>{
|
|
58917
|
+
if (!ignoreWarnings) return;
|
|
58918
|
+
return ignoreWarnings.map((ignore)=>{
|
|
58919
|
+
if ("function" == typeof ignore) return ignore;
|
|
58920
|
+
const rule = ignore instanceof RegExp ? {
|
|
58921
|
+
message: ignore
|
|
58922
|
+
} : ignore;
|
|
58923
|
+
return (warning)=>{
|
|
58924
|
+
if (!rule.message && !rule.module && !rule.file) return false;
|
|
58925
|
+
if (rule.message && !rule.message.test(warning.message)) return false;
|
|
58926
|
+
if (rule.module && (!warning.module || !rule.module.test(warning.module.readableIdentifier()))) return false;
|
|
58927
|
+
if (rule.file && (!warning.file || !rule.file.test(warning.file))) return false;
|
|
58928
|
+
return true;
|
|
58929
|
+
};
|
|
58930
|
+
});
|
|
58931
|
+
};
|
|
58879
58932
|
const getNormalizedRspackOptions = (config)=>({
|
|
58880
|
-
ignoreWarnings: config.ignoreWarnings
|
|
58881
|
-
if ("function" == typeof ignore) return ignore;
|
|
58882
|
-
const i = ignore instanceof RegExp ? {
|
|
58883
|
-
message: ignore
|
|
58884
|
-
} : ignore;
|
|
58885
|
-
return (warning)=>{
|
|
58886
|
-
if (!i.message && !i.module && !i.file) return false;
|
|
58887
|
-
if (i.message && !i.message.test(warning.message)) return false;
|
|
58888
|
-
if (i.module && (!warning.module || !i.module.test(warning.module.readableIdentifier()))) return false;
|
|
58889
|
-
if (i.file && (!warning.file || !i.file.test(warning.file))) return false;
|
|
58890
|
-
return true;
|
|
58891
|
-
};
|
|
58892
|
-
}) : void 0,
|
|
58933
|
+
ignoreWarnings: normalizeIgnoreWarnings(config.ignoreWarnings),
|
|
58893
58934
|
name: config.name,
|
|
58894
58935
|
dependencies: config.dependencies,
|
|
58895
58936
|
context: config.context,
|
|
@@ -59052,6 +59093,10 @@ const getNormalizedRspackOptions = (config)=>({
|
|
|
59052
59093
|
if (experiments.layers) util_default().deprecate(()=>{}, "`experiments.layers` config has been deprecated and will be removed in Rspack v2.0. Feature layers will be always enabled. Please remove this option from your Rspack configuration.")();
|
|
59053
59094
|
if (false === experiments.topLevelAwait) util_default().deprecate(()=>{}, "`experiments.topLevelAwait` config has been deprecated and will be removed in Rspack v2.0. Top-level await will be always enabled. Please remove this option from your Rspack configuration.")();
|
|
59054
59095
|
if (experiments.parallelCodeSplitting) util_default().deprecate(()=>{}, "`experiments.parallelCodeSplitting` config has been deprecated and will be removed in next minor. It has huge regression in some edge cases where the chunk graph has lots of cycles, we'll improve the performance of build_chunk_graph in the future instead")();
|
|
59096
|
+
if (experiments.lazyBarrel) util_default().deprecate(()=>{}, "`experiments.lazyBarrel` config has been deprecated and will be removed in Rspack v2.0. Lazy barrel is already stable and enabled by default. Please remove this option from your Rspack configuration.")();
|
|
59097
|
+
if (experiments.inlineConst) util_default().deprecate(()=>{}, "`experiments.inlineConst` config has been deprecated and will be removed in Rspack v2.0. Inline Const is already stable and enabled by default. Please remove this option from your Rspack configuration.")();
|
|
59098
|
+
if (experiments.inlineEnum) util_default().deprecate(()=>{}, "`experiments.inlineEnum` config has been deprecated and will be removed in Rspack v2.0. Inline Enum is already stable. Please remove this option from your Rspack configuration.")();
|
|
59099
|
+
if (experiments.typeReexportsPresence) util_default().deprecate(()=>{}, "`experiments.typeReexportsPresence` config has been deprecated and will be removed in Rspack v2.0. typeReexportsPresence is already stable. Please remove this option from your Rspack configuration.")();
|
|
59055
59100
|
return {
|
|
59056
59101
|
...experiments,
|
|
59057
59102
|
cache: optionalNestedConfig(experiments.cache, (cache)=>{
|
|
@@ -59533,7 +59578,7 @@ class ConcurrentCompilationError extends Error {
|
|
|
59533
59578
|
}
|
|
59534
59579
|
}
|
|
59535
59580
|
function rmrf(fs, p, callback) {
|
|
59536
|
-
fs.stat(p, (err, stats)=>{
|
|
59581
|
+
(fs.lstat || fs.stat)(p, (err, stats)=>{
|
|
59537
59582
|
if (err) {
|
|
59538
59583
|
if ("ENOENT" === err.code) return callback();
|
|
59539
59584
|
return callback(err);
|
|
@@ -59785,7 +59830,7 @@ class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
|
|
|
59785
59830
|
readFn(fd, {
|
|
59786
59831
|
position,
|
|
59787
59832
|
length
|
|
59788
|
-
}, (err,
|
|
59833
|
+
}, (err, _bytesRead, buffer)=>{
|
|
59789
59834
|
err ? resolve(err) : resolve(buffer);
|
|
59790
59835
|
});
|
|
59791
59836
|
});
|
|
@@ -60249,10 +60294,10 @@ function Resolver_class_private_field_set(receiver, privateMap, value) {
|
|
|
60249
60294
|
}
|
|
60250
60295
|
var _binding = /*#__PURE__*/ new WeakMap();
|
|
60251
60296
|
class Resolver {
|
|
60252
|
-
resolveSync(
|
|
60297
|
+
resolveSync(_context, path, request) {
|
|
60253
60298
|
return Resolver_class_private_field_get(this, _binding).resolveSync(path, request) ?? false;
|
|
60254
60299
|
}
|
|
60255
|
-
resolve(
|
|
60300
|
+
resolve(_context, path, request, resolveContext, callback) {
|
|
60256
60301
|
Resolver_class_private_field_get(this, _binding).resolve(path, request, (error, text)=>{
|
|
60257
60302
|
if (error) return void callback(error);
|
|
60258
60303
|
const req = text ? JSON.parse(text) : void 0;
|
|
@@ -60630,13 +60675,13 @@ const createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>
|
|
|
60630
60675
|
codeGenerationResult: new CodeGenerationResult(result),
|
|
60631
60676
|
moduleObject
|
|
60632
60677
|
}, {
|
|
60633
|
-
[
|
|
60678
|
+
[RuntimeGlobals.require]: moduleRequireFn
|
|
60634
60679
|
}), "Compilation.hooks.executeModule");
|
|
60635
60680
|
moduleObject.loaded = true;
|
|
60636
60681
|
return moduleObject.exports;
|
|
60637
60682
|
};
|
|
60638
|
-
const moduleCache = moduleRequireFn[
|
|
60639
|
-
const interceptModuleExecution = moduleRequireFn[
|
|
60683
|
+
const moduleCache = moduleRequireFn[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {};
|
|
60684
|
+
const interceptModuleExecution = moduleRequireFn[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
|
|
60640
60685
|
for (const runtimeModule of runtimeModules)moduleRequireFn(runtimeModule);
|
|
60641
60686
|
const executeResult = moduleRequireFn(entry);
|
|
60642
60687
|
getCompiler().__internal__get_module_execution_results_map().set(id, executeResult);
|
|
@@ -61230,10 +61275,10 @@ function VirtualModulesPlugin_class_private_field_set(receiver, privateMap, valu
|
|
|
61230
61275
|
}
|
|
61231
61276
|
const VirtualModulesPlugin_PLUGIN_NAME = "VirtualModulesPlugin";
|
|
61232
61277
|
const VFILES_BY_COMPILER = new WeakMap();
|
|
61233
|
-
var _staticModules = /*#__PURE__*/ new WeakMap(),
|
|
61278
|
+
var _staticModules = /*#__PURE__*/ new WeakMap(), VirtualModulesPlugin_compiler = /*#__PURE__*/ new WeakMap(), _store = /*#__PURE__*/ new WeakMap();
|
|
61234
61279
|
class VirtualModulesPlugin {
|
|
61235
61280
|
apply(compiler) {
|
|
61236
|
-
VirtualModulesPlugin_class_private_field_set(this,
|
|
61281
|
+
VirtualModulesPlugin_class_private_field_set(this, VirtualModulesPlugin_compiler, compiler);
|
|
61237
61282
|
compiler.hooks.afterEnvironment.tap(VirtualModulesPlugin_PLUGIN_NAME, ()=>{
|
|
61238
61283
|
const record = VFILES_BY_COMPILER.get(compiler) || {};
|
|
61239
61284
|
if (VirtualModulesPlugin_class_private_field_get(this, _staticModules)) for (const [filePath, content] of Object.entries(VirtualModulesPlugin_class_private_field_get(this, _staticModules))){
|
|
@@ -61244,15 +61289,15 @@ class VirtualModulesPlugin {
|
|
|
61244
61289
|
});
|
|
61245
61290
|
}
|
|
61246
61291
|
writeModule(filePath, contents) {
|
|
61247
|
-
if (!VirtualModulesPlugin_class_private_field_get(this,
|
|
61292
|
+
if (!VirtualModulesPlugin_class_private_field_get(this, VirtualModulesPlugin_compiler)) throw new Error("Plugin has not been initialized");
|
|
61248
61293
|
const store = this.getVirtualFileStore();
|
|
61249
|
-
const fullPath = path_browserify_default().resolve(VirtualModulesPlugin_class_private_field_get(this,
|
|
61294
|
+
const fullPath = path_browserify_default().resolve(VirtualModulesPlugin_class_private_field_get(this, VirtualModulesPlugin_compiler).context, filePath);
|
|
61250
61295
|
store.writeVirtualFileSync(fullPath, contents);
|
|
61251
|
-
notifyWatchers(VirtualModulesPlugin_class_private_field_get(this,
|
|
61296
|
+
notifyWatchers(VirtualModulesPlugin_class_private_field_get(this, VirtualModulesPlugin_compiler), fullPath, Date.now());
|
|
61252
61297
|
}
|
|
61253
61298
|
getVirtualFileStore() {
|
|
61254
61299
|
if (VirtualModulesPlugin_class_private_field_get(this, _store)) return VirtualModulesPlugin_class_private_field_get(this, _store);
|
|
61255
|
-
const store = VirtualModulesPlugin_class_private_field_get(this,
|
|
61300
|
+
const store = VirtualModulesPlugin_class_private_field_get(this, VirtualModulesPlugin_compiler)?.__internal__get_virtual_file_store();
|
|
61256
61301
|
if (!store) throw new Error("Virtual file store has not been initialized");
|
|
61257
61302
|
VirtualModulesPlugin_class_private_field_set(this, _store, store);
|
|
61258
61303
|
return store;
|
|
@@ -61272,7 +61317,7 @@ class VirtualModulesPlugin {
|
|
|
61272
61317
|
writable: true,
|
|
61273
61318
|
value: void 0
|
|
61274
61319
|
});
|
|
61275
|
-
VirtualModulesPlugin_class_private_field_init(this,
|
|
61320
|
+
VirtualModulesPlugin_class_private_field_init(this, VirtualModulesPlugin_compiler, {
|
|
61276
61321
|
writable: true,
|
|
61277
61322
|
value: void 0
|
|
61278
61323
|
});
|
|
@@ -62336,7 +62381,7 @@ class MultiStats {
|
|
|
62336
62381
|
return obj;
|
|
62337
62382
|
});
|
|
62338
62383
|
if (childOptions.version) {
|
|
62339
|
-
obj.rspackVersion = "1.
|
|
62384
|
+
obj.rspackVersion = "1.7.0-beta.0";
|
|
62340
62385
|
obj.version = "5.75.0";
|
|
62341
62386
|
}
|
|
62342
62387
|
if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
|
|
@@ -62908,7 +62953,13 @@ function IgnoreWarningsPlugin_define_property(obj, key, value) {
|
|
|
62908
62953
|
class IgnoreWarningsPlugin {
|
|
62909
62954
|
apply(compiler) {
|
|
62910
62955
|
compiler.hooks.compilation.tap(this.name, (compilation)=>{
|
|
62911
|
-
compilation.hooks.processWarnings.tap(this.name, (warnings)=>warnings.filter((warning)
|
|
62956
|
+
compilation.hooks.processWarnings.tap(this.name, (warnings)=>warnings.filter((warning)=>{
|
|
62957
|
+
const plainWarning = warning.message ? {
|
|
62958
|
+
...warning,
|
|
62959
|
+
message: util_default().stripVTControlCharacters(warning.message)
|
|
62960
|
+
} : warning;
|
|
62961
|
+
return !this._ignorePattern.some((ignore)=>ignore(plainWarning, compilation));
|
|
62962
|
+
}));
|
|
62912
62963
|
});
|
|
62913
62964
|
}
|
|
62914
62965
|
constructor(ignorePattern){
|
|
@@ -63612,10 +63663,15 @@ const SIMPLE_EXTRACTORS = {
|
|
|
63612
63663
|
if (depthInCollapsedGroup > 0) depthInCollapsedGroup--;
|
|
63613
63664
|
continue;
|
|
63614
63665
|
}
|
|
63615
|
-
|
|
63666
|
+
let message;
|
|
63667
|
+
if (entry.type === LogType.time) {
|
|
63668
|
+
const [label, first, second] = entry.args;
|
|
63669
|
+
if ("number" == typeof first && "number" == typeof second) message = `${label}: ${1000 * first + second / 1000000} ms`;
|
|
63670
|
+
}
|
|
63671
|
+
if (!message) message = entry.args?.length ? util.format(entry.args[0], ...entry.args.slice(1)) : "";
|
|
63616
63672
|
const newEntry = {
|
|
63617
63673
|
type,
|
|
63618
|
-
message,
|
|
63674
|
+
message: message || "",
|
|
63619
63675
|
trace: loggingTrace ? entry.trace : void 0,
|
|
63620
63676
|
children: type === LogType.group || type === LogType.groupCollapsed ? [] : void 0
|
|
63621
63677
|
};
|
|
@@ -63641,7 +63697,7 @@ const SIMPLE_EXTRACTORS = {
|
|
|
63641
63697
|
},
|
|
63642
63698
|
version: (object)=>{
|
|
63643
63699
|
object.version = "5.75.0";
|
|
63644
|
-
object.rspackVersion = "1.
|
|
63700
|
+
object.rspackVersion = "1.7.0-beta.0";
|
|
63645
63701
|
},
|
|
63646
63702
|
env: (object, _compilation, _context, { _env })=>{
|
|
63647
63703
|
object.env = _env;
|
|
@@ -63705,7 +63761,7 @@ const SIMPLE_EXTRACTORS = {
|
|
|
63705
63761
|
object.assets = limited.children;
|
|
63706
63762
|
object.filteredAssets = limited.filteredChildren;
|
|
63707
63763
|
},
|
|
63708
|
-
chunks: (object, compilation, context,
|
|
63764
|
+
chunks: (object, compilation, context, _options, factory)=>{
|
|
63709
63765
|
const { type, getStatsCompilation } = context;
|
|
63710
63766
|
const statsCompilation = getStatsCompilation(compilation);
|
|
63711
63767
|
const chunks = statsCompilation.chunks;
|
|
@@ -64332,8 +64388,8 @@ const NORMALIZER = {
|
|
|
64332
64388
|
value
|
|
64333
64389
|
] : [];
|
|
64334
64390
|
return array.map((filter)=>{
|
|
64335
|
-
if ("string" == typeof filter) return (
|
|
64336
|
-
if (filter instanceof RegExp) return (
|
|
64391
|
+
if ("string" == typeof filter) return (_warning, warningString)=>warningString.includes(filter);
|
|
64392
|
+
if (filter instanceof RegExp) return (_warning, warningString)=>filter.test(warningString);
|
|
64337
64393
|
if ("function" == typeof filter) return filter;
|
|
64338
64394
|
throw new Error(`Can only filter warnings with Strings or RegExps. (Given: ${filter})`);
|
|
64339
64395
|
});
|
|
@@ -65302,7 +65358,7 @@ class RspackOptionsApply {
|
|
|
65302
65358
|
if (options.optimization.providedExports) new FlagDependencyExportsPlugin().apply(compiler);
|
|
65303
65359
|
if (options.optimization.usedExports) new FlagDependencyUsagePlugin("global" === options.optimization.usedExports).apply(compiler);
|
|
65304
65360
|
if (options.optimization.concatenateModules) new ModuleConcatenationPlugin().apply(compiler);
|
|
65305
|
-
if (options.
|
|
65361
|
+
if (options.optimization.inlineExports) new InlineExportsPlugin().apply(compiler);
|
|
65306
65362
|
if (options.optimization.mangleExports) new MangleExportsPlugin("size" !== options.optimization.mangleExports).apply(compiler);
|
|
65307
65363
|
if (options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) for (const type of options.output.enabledLibraryTypes)new EnableLibraryPlugin(type).apply(compiler);
|
|
65308
65364
|
if (options.optimization.splitChunks) new SplitChunksPlugin(options.optimization.splitChunks).apply(compiler);
|
|
@@ -66251,7 +66307,7 @@ class ModuleFederationPlugin {
|
|
|
66251
66307
|
}
|
|
66252
66308
|
function collectManifestExposes(exposes) {
|
|
66253
66309
|
if (!exposes) return;
|
|
66254
|
-
const parsed = parseOptions(exposes, (value
|
|
66310
|
+
const parsed = parseOptions(exposes, (value)=>({
|
|
66255
66311
|
import: Array.isArray(value) ? value : [
|
|
66256
66312
|
value
|
|
66257
66313
|
],
|
|
@@ -66778,7 +66834,7 @@ function transformSync(source, options) {
|
|
|
66778
66834
|
const _options = JSON.stringify(options || {});
|
|
66779
66835
|
return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
|
|
66780
66836
|
}
|
|
66781
|
-
const exports_rspackVersion = "1.
|
|
66837
|
+
const exports_rspackVersion = "1.7.0-beta.0";
|
|
66782
66838
|
const exports_version = "5.75.0";
|
|
66783
66839
|
const exports_WebpackError = Error;
|
|
66784
66840
|
const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
|
|
@@ -66846,11 +66902,11 @@ const exports_experiments = {
|
|
|
66846
66902
|
}
|
|
66847
66903
|
},
|
|
66848
66904
|
RemoveDuplicateModulesPlugin: RemoveDuplicateModulesPlugin,
|
|
66905
|
+
SubresourceIntegrityPlugin: SubresourceIntegrityPlugin,
|
|
66849
66906
|
EsmLibraryPlugin: EsmLibraryPlugin,
|
|
66850
66907
|
RsdoctorPlugin: RsdoctorPlugin,
|
|
66851
66908
|
RstestPlugin: RstestPlugin,
|
|
66852
66909
|
RslibPlugin: RslibPlugin,
|
|
66853
|
-
SubresourceIntegrityPlugin: SubresourceIntegrityPlugin,
|
|
66854
66910
|
lazyCompilationMiddleware: lazyCompilationMiddleware,
|
|
66855
66911
|
swc: {
|
|
66856
66912
|
minify: minify,
|
|
@@ -67189,4 +67245,4 @@ var __webpack_exports__EntryDependency = external_rspack_wasi_browser_js_.EntryD
|
|
|
67189
67245
|
var __webpack_exports__ExternalModule = external_rspack_wasi_browser_js_.ExternalModule;
|
|
67190
67246
|
var __webpack_exports__Module = external_rspack_wasi_browser_js_.Module;
|
|
67191
67247
|
var __webpack_exports__NormalModule = external_rspack_wasi_browser_js_.NormalModule;
|
|
67192
|
-
export { BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefinePlugin, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, lib_EntryOptionPlugin as EntryOptionPlugin, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, DefaultRuntimeGlobals as RuntimeGlobals, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, statsFactoryUtils_StatsErrorCode as StatsErrorCode, SwcJsMinimizerRspackPlugin, Template, ValidationError, WarnCaseSensitiveModulesPlugin, exports_WebpackError as WebpackError, RspackOptionsApply as WebpackOptionsApply, builtinMemFs, exports_config as config, container, electron, exports_experiments as experiments, javascript, exports_library as library, exports_node as node, optimize, src_rspack_0 as rspack, exports_rspackVersion as rspackVersion, sharing, sources, exports_util as util, exports_version as version, exports_wasm as wasm, web, webworker, __webpack_exports__AsyncDependenciesBlock as AsyncDependenciesBlock, __webpack_exports__ConcatenatedModule as ConcatenatedModule, __webpack_exports__ContextModule as ContextModule, __webpack_exports__Dependency as Dependency, __webpack_exports__EntryDependency as EntryDependency, __webpack_exports__ExternalModule as ExternalModule, __webpack_exports__Module as Module, __webpack_exports__NormalModule as NormalModule };
|
|
67248
|
+
export { BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefinePlugin, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, lib_EntryOptionPlugin as EntryOptionPlugin, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, DefaultRuntimeGlobals as RuntimeGlobals, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, statsFactoryUtils_StatsErrorCode as StatsErrorCode, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, WarnCaseSensitiveModulesPlugin, exports_WebpackError as WebpackError, RspackOptionsApply as WebpackOptionsApply, builtinMemFs, exports_config as config, container, electron, exports_experiments as experiments, javascript, lazyCompilationMiddleware, exports_library as library, exports_node as node, optimize, src_rspack_0 as rspack, exports_rspackVersion as rspackVersion, sharing, sources, exports_util as util, exports_version as version, exports_wasm as wasm, web, webworker, __webpack_exports__AsyncDependenciesBlock as AsyncDependenciesBlock, __webpack_exports__ConcatenatedModule as ConcatenatedModule, __webpack_exports__ContextModule as ContextModule, __webpack_exports__Dependency as Dependency, __webpack_exports__EntryDependency as EntryDependency, __webpack_exports__ExternalModule as ExternalModule, __webpack_exports__Module as Module, __webpack_exports__NormalModule as NormalModule };
|
|
@@ -28,6 +28,6 @@ export declare class EntryOptionPlugin {
|
|
|
28
28
|
* @param desc entry description
|
|
29
29
|
* @returns options for the entry
|
|
30
30
|
*/
|
|
31
|
-
static entryDescriptionToOptions(
|
|
31
|
+
static entryDescriptionToOptions(_compiler: Compiler, name: string, desc: EntryDescriptionNormalized): EntryOptions;
|
|
32
32
|
}
|
|
33
33
|
export default EntryOptionPlugin;
|
package/dist/napi-binding.d.ts
CHANGED
|
@@ -816,6 +816,7 @@ export interface JsEntryOptions {
|
|
|
816
816
|
name?: string
|
|
817
817
|
runtime?: false | string
|
|
818
818
|
chunkLoading?: false | string
|
|
819
|
+
wasmLoading?: false | string
|
|
819
820
|
asyncChunks?: boolean
|
|
820
821
|
publicPath?: "auto" | JsFilename
|
|
821
822
|
baseUri?: string
|
|
@@ -2128,9 +2129,6 @@ rspackFuture?: RawRspackFuture
|
|
|
2128
2129
|
cache: boolean | { type: "persistent" } & RawExperimentCacheOptionsPersistent | { type: "memory" }
|
|
2129
2130
|
useInputFileSystem?: false | Array<RegExp>
|
|
2130
2131
|
css?: boolean
|
|
2131
|
-
inlineConst: boolean
|
|
2132
|
-
inlineEnum: boolean
|
|
2133
|
-
typeReexportsPresence: boolean
|
|
2134
2132
|
lazyBarrel: boolean
|
|
2135
2133
|
deferImport: boolean
|
|
2136
2134
|
}
|
|
@@ -2354,11 +2352,6 @@ commonjs?: boolean | { exports?: boolean | 'skipInEsm' }
|
|
|
2354
2352
|
*/
|
|
2355
2353
|
importDynamic?: boolean
|
|
2356
2354
|
commonjsMagicComments?: boolean
|
|
2357
|
-
/**
|
|
2358
|
-
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2359
|
-
* @experimental
|
|
2360
|
-
*/
|
|
2361
|
-
inlineConst?: boolean
|
|
2362
2355
|
/**
|
|
2363
2356
|
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2364
2357
|
* @experimental
|
|
@@ -2582,6 +2575,7 @@ export interface RawOptimizationOptions {
|
|
|
2582
2575
|
innerGraph: boolean
|
|
2583
2576
|
realContentHash: boolean
|
|
2584
2577
|
mangleExports: boolean | string
|
|
2578
|
+
inlineExports: boolean
|
|
2585
2579
|
concatenateModules: boolean
|
|
2586
2580
|
avoidEntryIife: boolean
|
|
2587
2581
|
}
|
|
Binary file
|
package/dist/util/fake.d.ts
CHANGED
|
@@ -3,7 +3,12 @@ export type FakeHook<T> = T & {
|
|
|
3
3
|
};
|
|
4
4
|
export declare function createFakeCompilationDependencies(getDeps: () => string[], addDeps: (deps: string[]) => void): {
|
|
5
5
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
6
|
-
has(dep: string)
|
|
6
|
+
has: (dep: string) => boolean;
|
|
7
7
|
add: (dep: string) => void;
|
|
8
8
|
addAll: (deps: Iterable<string>) => void;
|
|
9
|
+
delete: (dep: string) => boolean;
|
|
10
|
+
keys(): SetIterator<string>;
|
|
11
|
+
values(): SetIterator<string>;
|
|
12
|
+
entries(): SetIterator<[string, string]>;
|
|
13
|
+
readonly size: number;
|
|
9
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/browser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0-beta.0",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@rspack/lite-tapable": "1.1.0",
|
|
35
35
|
"@swc/types": "0.1.25",
|
|
36
36
|
"@types/watchpack": "^2.4.5",
|
|
37
|
-
"memfs": "4.
|
|
37
|
+
"memfs": "4.51.1",
|
|
38
38
|
"webpack-sources": "3.3.3"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|