@rspack/core 1.5.0-rc.0 → 1.5.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/Compiler.d.ts +5 -0
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +2 -1
- package/dist/index.js +21 -18
- package/dist/worker.js +1 -3
- package/package.json +2 -2
- package/dist/util/require.d.ts +0 -3
package/dist/Compiler.d.ts
CHANGED
@@ -94,6 +94,11 @@ declare class Compiler {
|
|
94
94
|
cache: Cache;
|
95
95
|
compilerPath: string;
|
96
96
|
options: RspackOptionsNormalized;
|
97
|
+
/**
|
98
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
99
|
+
* @internal
|
100
|
+
*/
|
101
|
+
__internal_browser_require: (id: string) => unknown;
|
97
102
|
constructor(context: string, options: RspackOptionsNormalized);
|
98
103
|
get recordsInputPath(): never;
|
99
104
|
get recordsOutputPath(): never;
|
@@ -5,7 +5,8 @@ export declare class ExternalsPlugin extends RspackBuiltinPlugin {
|
|
5
5
|
#private;
|
6
6
|
private type;
|
7
7
|
private externals;
|
8
|
+
private placeInInitial?;
|
8
9
|
name: BuiltinPluginName;
|
9
|
-
constructor(type: string, externals: Externals);
|
10
|
+
constructor(type: string, externals: Externals, placeInInitial?: boolean | undefined);
|
10
11
|
raw(): BuiltinPlugin | undefined;
|
11
12
|
}
|
package/dist/index.js
CHANGED
@@ -2997,9 +2997,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
2997
2997
|
]
|
2998
2998
|
}).catch(handleError);
|
2999
2999
|
});
|
3000
|
-
}),
|
3001
|
-
var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
|
3002
|
-
let LoaderLoadingError = class extends Error {
|
3000
|
+
}), LoaderLoadingError = class extends Error {
|
3003
3001
|
constructor(message){
|
3004
3002
|
super(message), this.name = "LoaderRunnerError", Error.captureStackTrace(this, this.constructor);
|
3005
3003
|
}
|
@@ -4010,17 +4008,19 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4010
4008
|
class ExternalsPlugin extends RspackBuiltinPlugin {
|
4011
4009
|
type;
|
4012
4010
|
externals;
|
4011
|
+
placeInInitial;
|
4013
4012
|
name = binding_.BuiltinPluginName.ExternalsPlugin;
|
4014
4013
|
#resolveRequestCache = new Map();
|
4015
|
-
constructor(type, externals){
|
4016
|
-
super(), this.type = type, this.externals = externals;
|
4014
|
+
constructor(type, externals, placeInInitial){
|
4015
|
+
super(), this.type = type, this.externals = externals, this.placeInInitial = placeInInitial;
|
4017
4016
|
}
|
4018
4017
|
raw() {
|
4019
4018
|
let type = this.type, externals = this.externals, raw = {
|
4020
4019
|
type,
|
4021
4020
|
externals: (Array.isArray(externals) ? externals : [
|
4022
4021
|
externals
|
4023
|
-
]).filter(Boolean).map((item)=>this.#getRawExternalItem(item))
|
4022
|
+
]).filter(Boolean).map((item)=>this.#getRawExternalItem(item)),
|
4023
|
+
placeInInitial: this.placeInInitial ?? !1
|
4024
4024
|
};
|
4025
4025
|
return createBuiltinPlugin(this.name, raw);
|
4026
4026
|
}
|
@@ -7095,7 +7095,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7095
7095
|
return !1;
|
7096
7096
|
}
|
7097
7097
|
}
|
7098
|
-
let compilationOptionsMap = new WeakMap(),
|
7098
|
+
let compilationOptionsMap = new WeakMap(), external_node_fs_namespaceObject = require("node:fs");
|
7099
|
+
var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
|
7100
|
+
let hooks_compilationHooksMap = new WeakMap(), HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
|
7099
7101
|
let templateFn, templateParameters, filenames;
|
7100
7102
|
validate(c, getHtmlPluginOptionsSchema);
|
7101
7103
|
let uid = HTML_PLUGIN_UID++, meta = {};
|
@@ -7164,9 +7166,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7164
7166
|
let context = this.options.context || process.cwd(), templateFilePath = external_node_path_default().resolve(context, filename);
|
7165
7167
|
if (!external_node_fs_default().existsSync(templateFilePath)) throw Error(`HtmlRspackPlugin: could not load file \`${filename}\` from \`${context}\``);
|
7166
7168
|
try {
|
7167
|
-
let renderer =
|
7168
|
-
return require(id);
|
7169
|
-
}(templateFilePath);
|
7169
|
+
let renderer = require(templateFilePath);
|
7170
7170
|
if (!1 === c.templateParameters) return await renderer({});
|
7171
7171
|
return await renderer(generateRenderData(data));
|
7172
7172
|
} catch (e) {
|
@@ -8629,7 +8629,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
8629
8629
|
}, applyExperimentsDefaults = (experiments, { production, development })=>{
|
8630
8630
|
defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), !1 === experiments.topLevelAwait && console.warn("`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."), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !1);
|
8631
8631
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
8632
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.5.0
|
8632
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.5.0"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
8633
8633
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName, inlineConst })=>{
|
8634
8634
|
if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), ((parserOptions, { inlineConst })=>{
|
8635
8635
|
D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "unknownContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
|
@@ -10272,7 +10272,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10272
10272
|
});
|
10273
10273
|
}
|
10274
10274
|
}
|
10275
|
-
let CORE_VERSION = "1.5.0
|
10275
|
+
let CORE_VERSION = "1.5.0", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
10276
10276
|
|
10277
10277
|
Help:
|
10278
10278
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
@@ -10572,6 +10572,7 @@ Help:
|
|
10572
10572
|
cache;
|
10573
10573
|
compilerPath;
|
10574
10574
|
options;
|
10575
|
+
__internal_browser_require;
|
10575
10576
|
constructor(context, options){
|
10576
10577
|
this.#initial = !0, this.#builtinPlugins = [], this.#nonSkippableRegisters = [], this.#moduleExecutionResultsMap = new Map(), this.#ruleSet = new RuleSetCompiler(), this.hooks = {
|
10577
10578
|
initialize: new lite_tapable_namespaceObject.SyncHook([]),
|
@@ -10659,7 +10660,9 @@ Help:
|
|
10659
10660
|
"entry"
|
10660
10661
|
]),
|
10661
10662
|
additionalPass: new lite_tapable_namespaceObject.AsyncSeriesHook([])
|
10662
|
-
}, this.webpack = src_rspack, this.rspack = src_rspack, this.root = this, this.outputPath = "", this.inputFileSystem = null, this.intermediateFileSystem = null, this.outputFileSystem = null, this.watchFileSystem = null, this.records = {}, this.options = options, this.context = context, this.cache = new Cache(), this.compilerPath = "", this.running = !1, this.idle = !1, this.watchMode = !1, this.
|
10663
|
+
}, this.webpack = src_rspack, this.rspack = src_rspack, this.root = this, this.outputPath = "", this.inputFileSystem = null, this.intermediateFileSystem = null, this.outputFileSystem = null, this.watchFileSystem = null, this.records = {}, this.options = options, this.context = context, this.cache = new Cache(), this.compilerPath = "", this.running = !1, this.idle = !1, this.watchMode = !1, this.__internal_browser_require = ()=>{
|
10664
|
+
throw Error("Cannot execute user defined code in browser without `BrowserRequirePlugin`");
|
10665
|
+
}, this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader), new JsLoaderRspackPlugin(this).apply(this), new ExecuteModulePlugin().apply(this), new TraceHookPlugin().apply(this);
|
10663
10666
|
}
|
10664
10667
|
get recordsInputPath() {
|
10665
10668
|
return unsupported("Compiler.recordsInputPath");
|
@@ -11553,7 +11556,7 @@ Help:
|
|
11553
11556
|
obj.children = this.stats.map((stat, idx)=>{
|
11554
11557
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
11555
11558
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
11556
|
-
}), childOptions.version && (obj.rspackVersion = "1.5.0
|
11559
|
+
}), childOptions.version && (obj.rspackVersion = "1.5.0", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
11557
11560
|
let mapError = (j, obj)=>({
|
11558
11561
|
...obj,
|
11559
11562
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
@@ -12453,7 +12456,7 @@ Help:
|
|
12453
12456
|
object.hash = context.getStatsCompilation(compilation).hash;
|
12454
12457
|
},
|
12455
12458
|
version: (object)=>{
|
12456
|
-
object.version = "5.75.0", object.rspackVersion = "1.5.0
|
12459
|
+
object.version = "5.75.0", object.rspackVersion = "1.5.0";
|
12457
12460
|
},
|
12458
12461
|
env: (object, _compilation, _context, { _env })=>{
|
12459
12462
|
object.env = _env;
|
@@ -13773,7 +13776,7 @@ Help:
|
|
13773
13776
|
}
|
13774
13777
|
class RspackOptionsApply {
|
13775
13778
|
process(options, compiler) {
|
13776
|
-
if (external_node_assert_default()(options.output.path, "options.output.path should have value after `applyRspackOptionsDefaults`"), compiler.outputPath = options.output.path, compiler.name = options.name, compiler.outputFileSystem = graceful_fs_index_js_default(), options.externals && (external_node_assert_default()(options.externalsType, "options.externalsType should have value after `applyRspackOptionsDefaults`"), new ExternalsPlugin(options.externalsType, options.externals).apply(compiler)), options.externalsPresets.node && new NodeTargetPlugin().apply(compiler), options.externalsPresets.electronMain && new ElectronTargetPlugin("main").apply(compiler), options.externalsPresets.electronPreload && new ElectronTargetPlugin("preload").apply(compiler), options.externalsPresets.electronRenderer && new ElectronTargetPlugin("renderer").apply(compiler), !options.externalsPresets.electron || options.externalsPresets.electronMain || options.externalsPresets.electronPreload || options.externalsPresets.electronRenderer || new ElectronTargetPlugin().apply(compiler), options.externalsPresets.nwjs && new ExternalsPlugin("node-commonjs", "nw.gui").apply(compiler), (options.externalsPresets.web || options.externalsPresets.webAsync || options.externalsPresets.node && options.experiments.css) && new HttpExternalsRspackPlugin(!!options.experiments.css, !!options.externalsPresets.webAsync).apply(compiler), new ChunkPrefetchPreloadPlugin().apply(compiler), options.output.pathinfo && new ModuleInfoHeaderPlugin("verbose" === options.output.pathinfo).apply(compiler), "string" == typeof options.output.chunkFormat) switch(options.output.chunkFormat){
|
13779
|
+
if (external_node_assert_default()(options.output.path, "options.output.path should have value after `applyRspackOptionsDefaults`"), compiler.outputPath = options.output.path, compiler.name = options.name, compiler.outputFileSystem = graceful_fs_index_js_default(), options.externals && (external_node_assert_default()(options.externalsType, "options.externalsType should have value after `applyRspackOptionsDefaults`"), new ExternalsPlugin(options.externalsType, options.externals, !1).apply(compiler)), options.externalsPresets.node && new NodeTargetPlugin().apply(compiler), options.externalsPresets.electronMain && new ElectronTargetPlugin("main").apply(compiler), options.externalsPresets.electronPreload && new ElectronTargetPlugin("preload").apply(compiler), options.externalsPresets.electronRenderer && new ElectronTargetPlugin("renderer").apply(compiler), !options.externalsPresets.electron || options.externalsPresets.electronMain || options.externalsPresets.electronPreload || options.externalsPresets.electronRenderer || new ElectronTargetPlugin().apply(compiler), options.externalsPresets.nwjs && new ExternalsPlugin("node-commonjs", "nw.gui", !1).apply(compiler), (options.externalsPresets.web || options.externalsPresets.webAsync || options.externalsPresets.node && options.experiments.css) && new HttpExternalsRspackPlugin(!!options.experiments.css, !!options.externalsPresets.webAsync).apply(compiler), new ChunkPrefetchPreloadPlugin().apply(compiler), options.output.pathinfo && new ModuleInfoHeaderPlugin("verbose" === options.output.pathinfo).apply(compiler), "string" == typeof options.output.chunkFormat) switch(options.output.chunkFormat){
|
13777
13780
|
case "array-push":
|
13778
13781
|
new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
|
13779
13782
|
break;
|
@@ -15746,7 +15749,7 @@ Help:
|
|
15746
15749
|
let i = 0;
|
15747
15750
|
for (let external of config.external)!external.startsWith("internal ") && (remoteExternals[`webpack/container/reference/${key}${i ? `/fallback-${i}` : ""}`] = external, i++);
|
15748
15751
|
}
|
15749
|
-
new ExternalsPlugin(remoteType, remoteExternals).apply(compiler), new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
|
15752
|
+
new ExternalsPlugin(remoteType, remoteExternals, !0).apply(compiler), new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
|
15750
15753
|
let rawOptions = {
|
15751
15754
|
remoteType: this._options.remoteType,
|
15752
15755
|
remotes: this._options.remotes.map(([key, r])=>({
|
@@ -15766,7 +15769,7 @@ Help:
|
|
15766
15769
|
let _options = JSON.stringify(options || {});
|
15767
15770
|
return binding_default().transform(source, _options);
|
15768
15771
|
}
|
15769
|
-
let exports_rspackVersion = "1.5.0
|
15772
|
+
let exports_rspackVersion = "1.5.0", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
15770
15773
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
15771
15774
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
15772
15775
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
package/dist/worker.js
CHANGED
@@ -559,9 +559,7 @@ for(var __webpack_i__ in (()=>{
|
|
559
559
|
let memoize = (fn)=>{
|
560
560
|
let result, cache = !1, callback = fn;
|
561
561
|
return ()=>(cache || (result = callback(), cache = !0, callback = void 0), result);
|
562
|
-
}
|
563
|
-
__webpack_require__("node:fs");
|
564
|
-
let LoaderLoadingError = class extends Error {
|
562
|
+
}, LoaderLoadingError = class extends Error {
|
565
563
|
constructor(message){
|
566
564
|
super(message), this.name = "LoaderRunnerError", Error.captureStackTrace(this, this.constructor);
|
567
565
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspack/core",
|
3
|
-
"version": "1.5.0
|
3
|
+
"version": "1.5.0",
|
4
4
|
"webpackVersion": "5.75.0",
|
5
5
|
"license": "MIT",
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
@@ -60,7 +60,7 @@
|
|
60
60
|
"dependencies": {
|
61
61
|
"@module-federation/runtime-tools": "0.18.0",
|
62
62
|
"@rspack/lite-tapable": "1.0.1",
|
63
|
-
"@rspack/binding": "1.5.0
|
63
|
+
"@rspack/binding": "1.5.0"
|
64
64
|
},
|
65
65
|
"peerDependencies": {
|
66
66
|
"@swc/helpers": ">=0.5.1"
|
package/dist/util/require.d.ts
DELETED