@rspack/core 1.5.0-beta.1 → 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/compiled/@swc/types/index.d.ts +3 -2
- package/compiled/@swc/types/package.json +1 -1
- package/dist/Compiler.d.ts +5 -0
- package/dist/NativeWatchFileSystem.d.ts +4 -0
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +2 -1
- package/dist/index.js +41 -35
- package/dist/worker.js +1 -3
- package/package.json +3 -3
- package/dist/util/require.d.ts +0 -3
@@ -487,7 +487,7 @@ interface Options extends Config {
|
|
487
487
|
*/
|
488
488
|
sourceRoot?: string;
|
489
489
|
plugin?: Plugin;
|
490
|
-
isModule?: boolean | "unknown";
|
490
|
+
isModule?: boolean | "unknown" | "commonjs";
|
491
491
|
/**
|
492
492
|
* Destination path. Note that this value is used only to fix source path
|
493
493
|
* of source map files and swc does not write output to this path.
|
@@ -731,7 +731,7 @@ interface EsParserConfig {
|
|
731
731
|
*/
|
732
732
|
importAssertions?: boolean;
|
733
733
|
/**
|
734
|
-
*
|
734
|
+
* @deprecated Always true in swc
|
735
735
|
*/
|
736
736
|
importAttributes?: boolean;
|
737
737
|
/**
|
@@ -785,6 +785,7 @@ interface TransformConfig {
|
|
785
785
|
* https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax
|
786
786
|
*/
|
787
787
|
verbatimModuleSyntax?: boolean;
|
788
|
+
tsEnumIsMutable?: boolean;
|
788
789
|
}
|
789
790
|
interface ReactConfig {
|
790
791
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"name":"@swc/types","author":"강동윤 <kdy1997.dev@gmail.com>","version":"0.1.
|
1
|
+
{"name":"@swc/types","author":"강동윤 <kdy1997.dev@gmail.com>","version":"0.1.24","license":"Apache-2.0","types":"index.d.ts","type":"commonjs"}
|
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;
|
@@ -16,4 +16,8 @@ export default class NativeWatchFileSystem implements WatchFileSystem {
|
|
16
16
|
}, _startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
|
17
17
|
getNativeWatcher(options: Watchpack.WatchOptions): binding.NativeWatcher;
|
18
18
|
triggerEvent(kind: "change" | "remove" | "create", path: string): void;
|
19
|
+
formatWatchDependencies(dependencies: Iterable<string> & {
|
20
|
+
added?: Iterable<string>;
|
21
|
+
removed?: Iterable<string>;
|
22
|
+
}): [string[], string[]];
|
19
23
|
}
|
@@ -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
@@ -228,9 +228,6 @@ var __webpack_modules__ = {
|
|
228
228
|
"node:https": function(module) {
|
229
229
|
module.exports = require("node:https");
|
230
230
|
},
|
231
|
-
"node:inspector": function(module) {
|
232
|
-
module.exports = require("node:inspector");
|
233
|
-
},
|
234
231
|
"node:os": function(module) {
|
235
232
|
module.exports = require("node:os");
|
236
233
|
},
|
@@ -250,6 +247,11 @@ var __webpack_modules__ = {
|
|
250
247
|
module.exports = import("../compiled/tinypool/dist/index.js").then(function(module) {
|
251
248
|
return module;
|
252
249
|
});
|
250
|
+
},
|
251
|
+
"node:inspector": function(module) {
|
252
|
+
module.exports = import("node:inspector").then(function(module) {
|
253
|
+
return module;
|
254
|
+
});
|
253
255
|
}
|
254
256
|
}, __webpack_module_cache__ = {};
|
255
257
|
function __webpack_require__(moduleId) {
|
@@ -2598,7 +2600,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
2598
2600
|
static session;
|
2599
2601
|
static counter = 10000;
|
2600
2602
|
static async initJavaScriptTrace(layer, output) {
|
2601
|
-
let { Session } = __webpack_require__("node:inspector");
|
2603
|
+
let { Session } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "node:inspector"));
|
2602
2604
|
this.session = new Session(), this.layer = layer, this.output = output, this.events = [], this.state = "on", this.startTime = process.hrtime.bigint();
|
2603
2605
|
}
|
2604
2606
|
static uuid() {
|
@@ -2995,9 +2997,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
2995
2997
|
]
|
2996
2998
|
}).catch(handleError);
|
2997
2999
|
});
|
2998
|
-
}),
|
2999
|
-
var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
|
3000
|
-
let LoaderLoadingError = class extends Error {
|
3000
|
+
}), LoaderLoadingError = class extends Error {
|
3001
3001
|
constructor(message){
|
3002
3002
|
super(message), this.name = "LoaderRunnerError", Error.captureStackTrace(this, this.constructor);
|
3003
3003
|
}
|
@@ -4008,17 +4008,19 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4008
4008
|
class ExternalsPlugin extends RspackBuiltinPlugin {
|
4009
4009
|
type;
|
4010
4010
|
externals;
|
4011
|
+
placeInInitial;
|
4011
4012
|
name = binding_.BuiltinPluginName.ExternalsPlugin;
|
4012
4013
|
#resolveRequestCache = new Map();
|
4013
|
-
constructor(type, externals){
|
4014
|
-
super(), this.type = type, this.externals = externals;
|
4014
|
+
constructor(type, externals, placeInInitial){
|
4015
|
+
super(), this.type = type, this.externals = externals, this.placeInInitial = placeInInitial;
|
4015
4016
|
}
|
4016
4017
|
raw() {
|
4017
4018
|
let type = this.type, externals = this.externals, raw = {
|
4018
4019
|
type,
|
4019
4020
|
externals: (Array.isArray(externals) ? externals : [
|
4020
4021
|
externals
|
4021
|
-
]).filter(Boolean).map((item)=>this.#getRawExternalItem(item))
|
4022
|
+
]).filter(Boolean).map((item)=>this.#getRawExternalItem(item)),
|
4023
|
+
placeInInitial: this.placeInInitial ?? !1
|
4022
4024
|
};
|
4023
4025
|
return createBuiltinPlugin(this.name, raw);
|
4024
4026
|
}
|
@@ -4118,7 +4120,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4118
4120
|
let HttpExternalsRspackPlugin = base_create(binding_.BuiltinPluginName.HttpExternalsRspackPlugin, (css, webAsync)=>({
|
4119
4121
|
css,
|
4120
4122
|
webAsync
|
4121
|
-
})), getHttp = memoize(()=>__webpack_require__("node:http")), getHttps = memoize(()=>__webpack_require__("node:https")),
|
4123
|
+
})), getHttp = memoize(()=>__webpack_require__("node:http")), getHttps = memoize(()=>__webpack_require__("node:https")), defaultHttpClientForNode = async (url, headers)=>{
|
4122
4124
|
let { res, body } = await function(url, options) {
|
4123
4125
|
let send = "https:" === new URL(url).protocol ? getHttps() : getHttp(), { createBrotliDecompress, createGunzip, createInflate } = __webpack_require__("node:zlib");
|
4124
4126
|
return new Promise((resolve, reject)=>{
|
@@ -4161,7 +4163,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4161
4163
|
lockfileLocation,
|
4162
4164
|
cacheLocation,
|
4163
4165
|
upgrade: options.upgrade ?? !1,
|
4164
|
-
httpClient: options.httpClient ??
|
4166
|
+
httpClient: options.httpClient ?? defaultHttpClientForNode
|
4165
4167
|
};
|
4166
4168
|
return createBuiltinPlugin(this.name, raw);
|
4167
4169
|
}
|
@@ -7093,7 +7095,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7093
7095
|
return !1;
|
7094
7096
|
}
|
7095
7097
|
}
|
7096
|
-
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 = {}) {
|
7097
7101
|
let templateFn, templateParameters, filenames;
|
7098
7102
|
validate(c, getHtmlPluginOptionsSchema);
|
7099
7103
|
let uid = HTML_PLUGIN_UID++, meta = {};
|
@@ -7162,9 +7166,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7162
7166
|
let context = this.options.context || process.cwd(), templateFilePath = external_node_path_default().resolve(context, filename);
|
7163
7167
|
if (!external_node_fs_default().existsSync(templateFilePath)) throw Error(`HtmlRspackPlugin: could not load file \`${filename}\` from \`${context}\``);
|
7164
7168
|
try {
|
7165
|
-
let renderer =
|
7166
|
-
return require(id);
|
7167
|
-
}(templateFilePath);
|
7169
|
+
let renderer = require(templateFilePath);
|
7168
7170
|
if (!1 === c.templateParameters) return await renderer({});
|
7169
7171
|
return await renderer(generateRenderData(data));
|
7170
7172
|
} catch (e) {
|
@@ -8627,7 +8629,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
8627
8629
|
}, applyExperimentsDefaults = (experiments, { production, development })=>{
|
8628
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);
|
8629
8631
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
8630
|
-
"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)));
|
8631
8633
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName, inlineConst })=>{
|
8632
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 })=>{
|
8633
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", [
|
@@ -10270,7 +10272,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10270
10272
|
});
|
10271
10273
|
}
|
10272
10274
|
}
|
10273
|
-
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.
|
10274
10276
|
|
10275
10277
|
Help:
|
10276
10278
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
@@ -10283,6 +10285,7 @@ Help:
|
|
10283
10285
|
`;
|
10284
10286
|
class NativeWatchFileSystem {
|
10285
10287
|
#inner;
|
10288
|
+
#isFirstWatch = !0;
|
10286
10289
|
#inputFileSystem;
|
10287
10290
|
constructor(inputFileSystem){
|
10288
10291
|
this.#inputFileSystem = inputFileSystem;
|
@@ -10294,16 +10297,7 @@ Help:
|
|
10294
10297
|
if ("object" != typeof options) throw Error("Invalid arguments: 'options'");
|
10295
10298
|
if ("function" != typeof callbackUndelayed && callbackUndelayed) throw Error("Invalid arguments: 'callbackUndelayed'");
|
10296
10299
|
let nativeWatcher = this.getNativeWatcher(options);
|
10297
|
-
return nativeWatcher.watch(
|
10298
|
-
Array.from(files.added),
|
10299
|
-
Array.from(files.removed)
|
10300
|
-
], [
|
10301
|
-
Array.from(directories.added),
|
10302
|
-
Array.from(directories.removed)
|
10303
|
-
], [
|
10304
|
-
Array.from(missing.added),
|
10305
|
-
Array.from(missing.removed)
|
10306
|
-
], (err, result)=>{
|
10300
|
+
return nativeWatcher.watch(this.formatWatchDependencies(files), this.formatWatchDependencies(directories), this.formatWatchDependencies(missing), (err, result)=>{
|
10307
10301
|
if (err) return void callback(err, new Map(), new Map(), new Set(), new Set());
|
10308
10302
|
nativeWatcher.pause();
|
10309
10303
|
let changedFiles = result.changedFiles, removedFiles = result.removedFiles;
|
@@ -10315,7 +10309,7 @@ Help:
|
|
10315
10309
|
callback(err, new Map(), new Map(), new Set(changedFiles), new Set(removedFiles));
|
10316
10310
|
}, (fileName)=>{
|
10317
10311
|
callbackUndelayed(fileName, Date.now());
|
10318
|
-
}), {
|
10312
|
+
}), this.#isFirstWatch = !1, {
|
10319
10313
|
close: ()=>{
|
10320
10314
|
nativeWatcher.close().then(()=>{
|
10321
10315
|
this.#inner = void 0;
|
@@ -10350,6 +10344,15 @@ Help:
|
|
10350
10344
|
triggerEvent(kind, path) {
|
10351
10345
|
this.#inner?.triggerEvent(kind, path);
|
10352
10346
|
}
|
10347
|
+
formatWatchDependencies(dependencies) {
|
10348
|
+
return this.#isFirstWatch ? [
|
10349
|
+
Array.from(dependencies),
|
10350
|
+
[]
|
10351
|
+
] : [
|
10352
|
+
Array.from(dependencies.added ?? []),
|
10353
|
+
Array.from(dependencies.removed ?? [])
|
10354
|
+
];
|
10355
|
+
}
|
10353
10356
|
}
|
10354
10357
|
let VFILES_BY_COMPILER = new WeakMap();
|
10355
10358
|
class VirtualModulesPlugin {
|
@@ -10569,6 +10572,7 @@ Help:
|
|
10569
10572
|
cache;
|
10570
10573
|
compilerPath;
|
10571
10574
|
options;
|
10575
|
+
__internal_browser_require;
|
10572
10576
|
constructor(context, options){
|
10573
10577
|
this.#initial = !0, this.#builtinPlugins = [], this.#nonSkippableRegisters = [], this.#moduleExecutionResultsMap = new Map(), this.#ruleSet = new RuleSetCompiler(), this.hooks = {
|
10574
10578
|
initialize: new lite_tapable_namespaceObject.SyncHook([]),
|
@@ -10656,7 +10660,9 @@ Help:
|
|
10656
10660
|
"entry"
|
10657
10661
|
]),
|
10658
10662
|
additionalPass: new lite_tapable_namespaceObject.AsyncSeriesHook([])
|
10659
|
-
}, 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);
|
10660
10666
|
}
|
10661
10667
|
get recordsInputPath() {
|
10662
10668
|
return unsupported("Compiler.recordsInputPath");
|
@@ -11550,7 +11556,7 @@ Help:
|
|
11550
11556
|
obj.children = this.stats.map((stat, idx)=>{
|
11551
11557
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
11552
11558
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
11553
|
-
}), 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(""));
|
11554
11560
|
let mapError = (j, obj)=>({
|
11555
11561
|
...obj,
|
11556
11562
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
@@ -12450,7 +12456,7 @@ Help:
|
|
12450
12456
|
object.hash = context.getStatsCompilation(compilation).hash;
|
12451
12457
|
},
|
12452
12458
|
version: (object)=>{
|
12453
|
-
object.version = "5.75.0", object.rspackVersion = "1.5.0
|
12459
|
+
object.version = "5.75.0", object.rspackVersion = "1.5.0";
|
12454
12460
|
},
|
12455
12461
|
env: (object, _compilation, _context, { _env })=>{
|
12456
12462
|
object.env = _env;
|
@@ -13770,7 +13776,7 @@ Help:
|
|
13770
13776
|
}
|
13771
13777
|
class RspackOptionsApply {
|
13772
13778
|
process(options, compiler) {
|
13773
|
-
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){
|
13774
13780
|
case "array-push":
|
13775
13781
|
new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
|
13776
13782
|
break;
|
@@ -15743,7 +15749,7 @@ Help:
|
|
15743
15749
|
let i = 0;
|
15744
15750
|
for (let external of config.external)!external.startsWith("internal ") && (remoteExternals[`webpack/container/reference/${key}${i ? `/fallback-${i}` : ""}`] = external, i++);
|
15745
15751
|
}
|
15746
|
-
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);
|
15747
15753
|
let rawOptions = {
|
15748
15754
|
remoteType: this._options.remoteType,
|
15749
15755
|
remotes: this._options.remotes.map(([key, r])=>({
|
@@ -15763,7 +15769,7 @@ Help:
|
|
15763
15769
|
let _options = JSON.stringify(options || {});
|
15764
15770
|
return binding_default().transform(source, _options);
|
15765
15771
|
}
|
15766
|
-
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 = {
|
15767
15773
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
15768
15774
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
15769
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",
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"@ast-grep/napi": "^0.39.1",
|
41
41
|
"@rsbuild/plugin-node-polyfill": "^1.4.1",
|
42
42
|
"@rslib/core": "0.12.1",
|
43
|
-
"@swc/types": "0.1.
|
43
|
+
"@swc/types": "0.1.24",
|
44
44
|
"@types/graceful-fs": "4.1.9",
|
45
45
|
"@types/watchpack": "^2.4.4",
|
46
46
|
"browserslist-load-config": "^1.0.0",
|
@@ -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