@rsbuild/core 2.2.0-beta.2 → 2.2.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.
@@ -1,15 +1,15 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 496: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(606)["default"];
4
+ 534: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(836)["default"];
6
6
  },
7
- 606: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 836: (__unused_webpack_module, exports, __nccwpck_require__) => {
8
8
  var __webpack_unused_export__;
9
9
  __webpack_unused_export__ = { value: true };
10
10
  exports["default"] = loader;
11
11
  var _nodePath = _interopRequireDefault(__nccwpck_require__(760));
12
- var _utils = __nccwpck_require__(255);
12
+ var _utils = __nccwpck_require__(357);
13
13
  function _interopRequireDefault(e) {
14
14
  return e && e.__esModule ? e : { default: e };
15
15
  }
@@ -179,7 +179,7 @@
179
179
  callback(null, result.css, map, { ast });
180
180
  }
181
181
  },
182
- 255: (module, exports, __nccwpck_require__) => {
182
+ 357: (module, exports, __nccwpck_require__) => {
183
183
  module = __nccwpck_require__.nmd(module);
184
184
  Object.defineProperty(exports, "__esModule", { value: true });
185
185
  exports.exec = exec;
@@ -716,6 +716,6 @@
716
716
  })();
717
717
  if (typeof __nccwpck_require__ !== "undefined")
718
718
  __nccwpck_require__.ab = __dirname + "/";
719
- var __webpack_exports__ = __nccwpck_require__(496);
719
+ var __webpack_exports__ = __nccwpck_require__(534);
720
720
  module.exports = __webpack_exports__;
721
721
  })();
package/dist/626.js CHANGED
@@ -3079,30 +3079,30 @@ async function initPlugins({ context, pluginManager }) {
3079
3079
  context.logger.debug('initializing plugins');
3080
3080
  let plugins = pluginManager.getAllPluginsWithMeta();
3081
3081
  plugins = ((plugins)=>{
3082
- let allLines = [];
3082
+ let allLines = [], pluginNames = new Set(plugins.map((item)=>item.instance.name));
3083
3083
  function getPlugin(name) {
3084
3084
  let targets = plugins.filter((item)=>item.instance.name === name);
3085
3085
  if (!targets.length) throw Error(`${color.dim('[rsbuild:plugin]')} Plugin "${color.yellow(name)}" not existed`);
3086
3086
  return targets;
3087
3087
  }
3088
3088
  for (let plugin of plugins){
3089
- if (plugin.instance.pre) for (let pre of plugin.instance.pre)pre && plugins.some((item)=>item.instance.name === pre) && allLines.push([
3089
+ if (plugin.instance.pre) for (let pre of plugin.instance.pre)pre && pluginNames.has(pre) && allLines.push([
3090
3090
  pre,
3091
3091
  plugin.instance.name
3092
3092
  ]);
3093
- if (plugin.instance.post) for (let post of plugin.instance.post)post && plugins.some((item)=>item.instance.name === post) && allLines.push([
3093
+ if (plugin.instance.post) for (let post of plugin.instance.post)post && pluginNames.has(post) && allLines.push([
3094
3094
  plugin.instance.name,
3095
3095
  post
3096
3096
  ]);
3097
3097
  }
3098
- let zeroEndPoints = plugins.filter((item)=>!allLines.find((l)=>l[1] === item.instance.name)), sortedPoint = [];
3098
+ let endPoints = new Set(allLines.map((line)=>line[1])), zeroEndPoints = plugins.filter((item)=>!endPoints.has(item.instance.name)), sortedPoint = [], sortedPluginNames = new Set();
3099
3099
  for(; zeroEndPoints.length;){
3100
- let pluginInstances = getPlugin(zeroEndPoints.shift().instance.name);
3101
- sortedPoint.push(...pluginInstances), allLines = allLines.filter((l)=>l[0] !== pluginInstances[0].instance.name), zeroEndPoints = plugins.filter((item)=>!sortedPoint.find((sp)=>sp.instance.name === item.instance.name)).filter((item)=>!allLines.find((l)=>l[1] === item.instance.name));
3100
+ let { name } = zeroEndPoints[0].instance, pluginInstances = getPlugin(name);
3101
+ sortedPoint.push(...pluginInstances), sortedPluginNames.add(name), endPoints = new Set((allLines = allLines.filter((line)=>line[0] !== name)).map((line)=>line[1])), zeroEndPoints = plugins.filter((item)=>!sortedPluginNames.has(item.instance.name) && !endPoints.has(item.instance.name));
3102
3102
  }
3103
3103
  if (allLines.length) {
3104
3104
  let restInRingPoints = {};
3105
- for (let l of allLines)restInRingPoints[l[0]] = !0, restInRingPoints[l[1]] = !0;
3105
+ for (let line of allLines)restInRingPoints[line[0]] = !0, restInRingPoints[line[1]] = !0;
3106
3106
  throw Error(`${color.dim('[rsbuild:plugin]')} Plugins dependencies has loop: ${color.yellow(Object.keys(restInRingPoints).join(','))}`);
3107
3107
  }
3108
3108
  return sortedPoint;
@@ -3425,7 +3425,7 @@ function createPublicContext(context) {
3425
3425
  async function createContext(options, userConfig, logger, loadConfigResult) {
3426
3426
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = join(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, hooks = initHooks();
3427
3427
  return {
3428
- version: "2.2.0-beta.2",
3428
+ version: "2.2.0",
3429
3429
  rootPath,
3430
3430
  configFile: loadConfigResult?.filePath ?? userConfig._privateMeta?.configFilePath,
3431
3431
  configFileDependencies: loadConfigResult?.dependencies ?? userConfig._privateMeta?.configFileDependencies ?? [],
@@ -5473,7 +5473,7 @@ let entryNameSymbol = Symbol('entryName'), VOID_TAGS = [
5473
5473
  }, getTagPriority = (tag, tagConfig)=>{
5474
5474
  let priority = tag.head ?? HEAD_TAGS.includes(tag.tag) ? -2 : 2, append = tag.append ?? tagConfig.append;
5475
5475
  return 'boolean' == typeof append && (priority += append ? 1 : -1), priority;
5476
- }, formatBasicTag = (tag)=>({
5476
+ }, sortTags = (tags, tagConfig)=>tags.sort((tag1, tag2)=>getTagPriority(tag1, tagConfig) - getTagPriority(tag2, tagConfig)), formatBasicTag = (tag)=>({
5477
5477
  tag: tag.tagName,
5478
5478
  attrs: tag.attributes,
5479
5479
  children: tag.innerHTML,
@@ -5610,8 +5610,9 @@ class RsbuildHtmlPlugin {
5610
5610
  entryName,
5611
5611
  outputName: data.outputName,
5612
5612
  publicPath: data.publicPath
5613
- };
5614
- for (let item of tagConfig.tags)isFunction(item) ? tags = item(tags, context) || tags : tags.push(item), tags = tags.sort((tag1, tag2)=>getTagPriority(tag1, tagConfig) - getTagPriority(tag2, tagConfig));
5613
+ }, shouldSort = !1;
5614
+ for (let item of tagConfig.tags)isFunction(item) ? (shouldSort && (tags = sortTags(tags, tagConfig)), tags = item(tags, context) || tags) : tags.push(item), shouldSort = !0;
5615
+ shouldSort && (tags = sortTags(tags, tagConfig));
5615
5616
  let [headTags, bodyTags] = partition(tags, (tag)=>tag.head ?? HEAD_TAGS.includes(tag.tag));
5616
5617
  return data.headTags = fromInjectTags(headTags), data.bodyTags = fromInjectTags(bodyTags);
5617
5618
  })(data, tagConfig, compilation.hash ?? '', entryName), data;
@@ -6183,22 +6184,35 @@ let HtmlResourceHintsPlugin_defaultOptions = {
6183
6184
  type: 'async-chunks',
6184
6185
  dedupe: !0
6185
6186
  };
6186
- function filterResourceHints(resourceHints, scripts) {
6187
- return resourceHints.filter((resourceHint)=>!scripts.find((script)=>script.attributes.src === resourceHint.attributes.href));
6187
+ function filterResourceHints(resourceHints, scriptSources) {
6188
+ return resourceHints.filter((resourceHint)=>!scriptSources.has(resourceHint.attributes.href));
6188
6189
  }
6189
6190
  function getResourceHintKey(resourceHint) {
6190
6191
  return `${resourceHint.attributes.rel}:${resourceHint.attributes.href}`;
6191
6192
  }
6192
6193
  function mergeResourceHints(resourceHintGroups, scripts) {
6193
- let links = [], seen = new Set();
6194
- for (let { links: groupLinks, dedupe } of resourceHintGroups)for (let link of dedupe ? filterResourceHints(groupLinks, scripts) : groupLinks){
6195
- let key = getResourceHintKey(link);
6196
- seen.has(key) || (seen.add(key), links.push(link));
6194
+ let scriptSources, links = [], seen = new Set();
6195
+ for (let { links: groupLinks, dedupe } of resourceHintGroups){
6196
+ let filteredLinks = groupLinks;
6197
+ for (let link of (dedupe && (scriptSources ??= new Set(scripts.map((script)=>script.attributes.src)), filteredLinks = filterResourceHints(groupLinks, scriptSources)), filteredLinks)){
6198
+ let key = getResourceHintKey(link);
6199
+ seen.has(key) || (seen.add(key), links.push(link));
6200
+ }
6197
6201
  }
6198
6202
  return links;
6199
6203
  }
6200
6204
  function generateLinks(options, type, compilation, data, HTMLCount, isDev) {
6201
- let extractedChunks = extractChunks(compilation, options.type), sortedFilteredFiles = ((files, include, exclude)=>{
6205
+ let extractedChunks = extractChunks(compilation, options.type), htmlChunks = 'all-assets' === options.type || 1 === HTMLCount ? extractedChunks : extractedChunks.filter((chunk)=>doesChunkBelongToHtml({
6206
+ chunk: chunk,
6207
+ compilation,
6208
+ htmlPluginData: data,
6209
+ pluginOptions: options
6210
+ })), uniqueFiles = new Set();
6211
+ for (let chunk of htmlChunks)for (let files of [
6212
+ chunk.files,
6213
+ chunk.auxiliaryFiles ?? []
6214
+ ])for (let file of files)isDev && file.endsWith('.hot-update.js') || file.endsWith('.map') || uniqueFiles.add(file);
6215
+ let sortedFilteredFiles = ((files, include, exclude)=>{
6202
6216
  let includeRegExp = [], excludeRegExp = [], includeFn = [], excludeFn = [];
6203
6217
  if (include) for (let item of helpers_castArray(include))'string' == typeof item ? includeRegExp.push(new RegExp(item)) : isFunction(item) ? includeFn.push(item) : includeRegExp.push(item);
6204
6218
  if (exclude) for (let item of helpers_castArray(exclude))'string' == typeof item ? excludeRegExp.push(new RegExp(item)) : isFunction(item) ? excludeFn.push(item) : excludeRegExp.push(item);
@@ -6212,15 +6226,7 @@ function generateLinks(options, type, compilation, data, HTMLCount, isDev) {
6212
6226
  return !0;
6213
6227
  });
6214
6228
  })([
6215
- ...new Set(('all-assets' === options.type || 1 === HTMLCount ? extractedChunks : extractedChunks.filter((chunk)=>doesChunkBelongToHtml({
6216
- chunk: chunk,
6217
- compilation,
6218
- htmlPluginData: data,
6219
- pluginOptions: options
6220
- }))).reduce((accumulated, chunk)=>accumulated.concat([
6221
- ...chunk.files,
6222
- ...chunk.auxiliaryFiles || []
6223
- ]), []).filter((file)=>!(isDev && file.endsWith('.hot-update.js')) && !file.endsWith('.map')))
6229
+ ...uniqueFiles
6224
6230
  ], options.include, options.exclude).sort(), links = [], { publicPath, crossOriginLoading } = compilation.outputOptions;
6225
6231
  for (let file of sortedFilteredFiles){
6226
6232
  let href = ensureAssetPrefix(file, publicPath), attributes = {
@@ -6333,6 +6339,7 @@ function resolveDefaultPreset(config) {
6333
6339
  }
6334
6340
  function resolvePerPackagePreset() {
6335
6341
  return {
6342
+ chunks: 'all',
6336
6343
  minSize: 0,
6337
6344
  maxInitialRequests: 1 / 0,
6338
6345
  cacheGroups: {
@@ -6560,7 +6567,11 @@ async function resolveHostname(host = LOCALHOST) {
6560
6567
  }
6561
6568
  return void 0 === host || WILDCARD_HOSTS.has(host) ? LOCALHOST : host;
6562
6569
  }
6563
- let UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
6570
+ let UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/, getFileFromUrl_stat = (filename, outputFileSystem)=>new Promise((resolve, reject)=>{
6571
+ outputFileSystem.stat(filename, (err, stats)=>{
6572
+ err ? reject(err) : resolve(stats);
6573
+ });
6574
+ });
6564
6575
  async function getFileFromUrl(url, outputFileSystem, context) {
6565
6576
  let pathname = getPathnameFromUrl(url);
6566
6577
  try {
@@ -6577,11 +6588,7 @@ async function getFileFromUrl(url, outputFileSystem, context) {
6577
6588
  if (UP_PATH_REGEXP.test(node_path.normalize(`./${pathname}`))) return {
6578
6589
  errorCode: 403
6579
6590
  };
6580
- let stat = async (filename)=>new Promise((resolve, reject)=>{
6581
- outputFileSystem.stat(filename, (err, stats)=>{
6582
- err ? reject(err) : resolve(stats);
6583
- });
6584
- }), { environmentList, publicPathnames } = context, distPaths = environmentList.map((env)=>env.distPath), possibleFilenames = new Set();
6591
+ let { environmentList, publicPathnames } = context, distPaths = environmentList.map((env)=>env.distPath), possibleFilenames = new Set();
6585
6592
  for (let [index, distPath] of distPaths.entries()){
6586
6593
  let prefix = publicPathnames[index];
6587
6594
  prefix && '/' !== prefix && isUrlPathUnderBase(pathname, prefix) && possibleFilenames.add(node_path.join(distPath, pathname.slice(prefix.length)));
@@ -6590,7 +6597,7 @@ async function getFileFromUrl(url, outputFileSystem, context) {
6590
6597
  for (let filename of possibleFilenames){
6591
6598
  let fsStats;
6592
6599
  try {
6593
- fsStats = await stat(filename);
6600
+ fsStats = await getFileFromUrl_stat(filename, outputFileSystem);
6594
6601
  } catch {
6595
6602
  continue;
6596
6603
  }
@@ -6602,7 +6609,7 @@ async function getFileFromUrl(url, outputFileSystem, context) {
6602
6609
  if (fsStats.isDirectory()) {
6603
6610
  filename = node_path.join(filename, 'index.html');
6604
6611
  try {
6605
- fsStats = await stat(filename);
6612
+ fsStats = await getFileFromUrl_stat(filename, outputFileSystem);
6606
6613
  } catch {
6607
6614
  continue;
6608
6615
  }
@@ -6887,8 +6894,8 @@ function applyHMREntry({ config, compiler, token, resolvedHost, resolvedPort })
6887
6894
  var overlay;
6888
6895
  let overlay1;
6889
6896
  if (!((compiler)=>{
6890
- let { target } = compiler.options;
6891
- return !!target && (Array.isArray(target) ? target.includes('web') : 'web' === target);
6897
+ let { platform } = compiler;
6898
+ return !!(platform.web && !platform.webworker && compiler.options.output.environment?.document);
6892
6899
  })(compiler) || !config.dev.hmr && !config.dev.liveReload) return;
6893
6900
  let { enabled: liveReloadEnabled } = normalizeLiveReload(config.dev.liveReload), { webSocketUrlResolver, ...clientConfig } = {
6894
6901
  ...config.dev.client
@@ -7944,7 +7951,7 @@ class BasicRunner {
7944
7951
  subPath: ''
7945
7952
  };
7946
7953
  let joinedPath = /^\.\.?\//.test(modulePath) ? node_path.join(currentDirectory, modulePath) : modulePath;
7947
- return this._options.isBundleOutput(joinedPath) ? {
7954
+ return this._options.isOutputFile(joinedPath) ? {
7948
7955
  path: joinedPath,
7949
7956
  content: this._options.readFileSync(joinedPath),
7950
7957
  subPath: ((p)=>{
@@ -8103,14 +8110,18 @@ class BasicRunnerFactory {
8103
8110
  let runner_run = async ({ bundlePath, ...runnerFactoryOptions })=>{
8104
8111
  let runner = new BasicRunnerFactory(bundlePath).create(runnerFactoryOptions);
8105
8112
  return await runner.run(bundlePath);
8106
- }, loadBundle = async (stats, entryName, utils)=>{
8107
- let { chunks, entrypoints, outputPath } = stats.toJson({
8108
- all: !1,
8109
- chunks: !0,
8110
- entrypoints: !0,
8111
- ids: !0,
8112
- outputPath: !0
8113
- });
8113
+ }, loadBundleStatsCache = new WeakMap(), loadBundle = async (stats, entryName, utils)=>{
8114
+ let loadBundleStats = loadBundleStatsCache.get(stats);
8115
+ loadBundleStats || (loadBundleStats = {
8116
+ ...stats.toJson({
8117
+ all: !1,
8118
+ chunks: !0,
8119
+ entrypoints: !0,
8120
+ ids: !0,
8121
+ outputPath: !0
8122
+ })
8123
+ }, loadBundleStatsCache.set(stats, loadBundleStats));
8124
+ let { chunks, entrypoints, outputPath } = loadBundleStats;
8114
8125
  if (!entrypoints?.[entryName]) throw Error(`${color.dim('[rsbuild:loadBundle]')} Can't find entry: ${color.yellow(entryName)}`);
8115
8126
  let { chunks: entryChunks = [] } = entrypoints[entryName], files = entryChunks.reduce((prev, entryChunkId)=>{
8116
8127
  let chunk = chunks?.find((chunk)=>chunk.entry && chunk.id === entryChunkId);
@@ -8118,13 +8129,17 @@ let runner_run = async ({ bundlePath, ...runnerFactoryOptions })=>{
8118
8129
  }, []);
8119
8130
  if (0 === files.length) throw Error(`${color.dim('[rsbuild:loadBundle]')} Failed to get bundle by entryName: ${color.yellow(entryName)}`);
8120
8131
  if (files.length > 1) throw Error(`${color.dim('[rsbuild:loadBundle]')} Only support load single entry chunk, but got ${color.yellow(files.length)}: ${files.join(',')}`);
8121
- let allChunkFiles = chunks?.flatMap((c)=>c.files).map((file)=>join(outputPath, file)) || [];
8132
+ let { outputFilePaths } = loadBundleStats;
8133
+ if (!outputFilePaths) {
8134
+ for (let chunk of (outputFilePaths = new Set(), chunks || []))for (let file of chunk.files)outputFilePaths.add(join(outputPath, file));
8135
+ loadBundleStats.outputFilePaths = outputFilePaths;
8136
+ }
8122
8137
  return await runner_run({
8123
8138
  bundlePath: files[0],
8124
8139
  dist: outputPath,
8125
8140
  compilerOptions: stats.compilation.options,
8126
8141
  readFileSync: utils.readFileSync,
8127
- isBundleOutput: (modulePath)=>allChunkFiles.includes(modulePath)
8142
+ isOutputFile: (modulePath)=>outputFilePaths.has(modulePath)
8128
8143
  });
8129
8144
  }, createCacheableFunction = (getter)=>{
8130
8145
  let cache = new WeakMap();
@@ -9379,7 +9394,8 @@ try {
9379
9394
  else {
9380
9395
  let { preset = 'none', ...rest } = splitChunks;
9381
9396
  chain.optimization.splitChunks({
9382
- chunks: 'all',
9397
+ chunks: Object.keys(environment.entry).length > 1 ? 'all' : 'async',
9398
+ minSize: 0,
9383
9399
  ...getSplitChunksByPreset(config, preset),
9384
9400
  ...rest
9385
9401
  });
@@ -9642,18 +9658,20 @@ try {
9642
9658
  api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev })=>{
9643
9659
  let { output: { manifest }, dev: { writeToDisk } } = environment.config;
9644
9660
  if (!1 === manifest) return;
9645
- let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = await import("./manifest-plugin.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-beta.1/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
9661
+ let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = await import("./manifest-plugin.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
9646
9662
  manifestFilenames.set(environment.name, manifestOptions.filename);
9647
9663
  let pluginOptions = {
9648
9664
  fileName: manifestOptions.filename,
9649
9665
  filter,
9650
9666
  writeToFileEmit: isDev && !0 !== writeToDisk,
9651
9667
  generate: (_seed, files, entries, { compilation })=>{
9652
- let chunkEntries = new Map(), licenseMap = new Map(), publicPath = getPublicPathFromCompiler(compilation), integrity = {}, allFiles = files.map((file)=>{
9653
- if (file.integrity && (integrity[file.path] = file.integrity), file.chunk) for (let entryName of recursiveChunkEntryNames(file.chunk))chunkEntries.set(entryName, [
9654
- file,
9655
- ...chunkEntries.get(entryName) || []
9656
- ]);
9668
+ let chunkEntries = new Map(), filePathByName = new Map(), licenseMap = new Map(), publicPath = getPublicPathFromCompiler(compilation), integrity = {}, allFiles = files.map((file)=>{
9669
+ if (filePathByName.has(file.name) || filePathByName.set(file.name, file.path), file.integrity && (integrity[file.path] = file.integrity), file.chunk) for (let entryName of recursiveChunkEntryNames(file.chunk)){
9670
+ let chunkFiles = chunkEntries.get(entryName);
9671
+ chunkFiles ? chunkFiles.push(file) : chunkEntries.set(entryName, [
9672
+ file
9673
+ ]);
9674
+ }
9657
9675
  if (file.path.endsWith('.LICENSE.txt')) {
9658
9676
  let sourceFilePath = file.path.split('.LICENSE.txt')[0];
9659
9677
  licenseMap.set(sourceFilePath, file.path);
@@ -9673,7 +9691,7 @@ try {
9673
9691
  }
9674
9692
  let entryManifest = {};
9675
9693
  assets.size && (entryManifest.assets = Array.from(assets));
9676
- let htmlPath = files.find((f)=>f.name === htmlPaths[entryName])?.path;
9694
+ let htmlPath = filePathByName.get(htmlPaths[entryName]);
9677
9695
  htmlPath && (entryManifest.html = [
9678
9696
  htmlPath
9679
9697
  ]), initialJS.length && (entryManifest.initial = {
@@ -10183,7 +10201,7 @@ let applyServerOptions = (command)=>{
10183
10201
  };
10184
10202
  function setupCommands(argv) {
10185
10203
  let cli = ((name = "")=>new CAC(name))('rsbuild');
10186
- cli.version("2.2.0-beta.2"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
10204
+ cli.version("2.2.0"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
10187
10205
  default: 'auto'
10188
10206
  }).option('--dist-path <dir>', 'Set the root directory of output files').option('--source-map', 'Enable source map').option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
10189
10207
  type: [
@@ -10248,7 +10266,7 @@ function setupCommands(argv) {
10248
10266
  }
10249
10267
  function showGreeting() {
10250
10268
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
10251
- src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.2.0-beta.2\n`);
10269
+ src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.2.0\n`);
10252
10270
  }
10253
10271
  function setupLogLevel(argv) {
10254
10272
  if (argv.length <= 3) return;
@@ -10270,5 +10288,5 @@ function runCLI({ argv = process.argv } = {}) {
10270
10288
  src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
10271
10289
  }
10272
10290
  }
10273
- let src_version = "2.2.0-beta.2";
10291
+ let src_version = "2.2.0";
10274
10292
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, core_rspack as rspack, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig_loadConfig as loadConfig, loadEnv, logger_createLogger as createLogger, mergeRsbuildConfig, mrmime_lookup, runCLI, src_logger as logger, src_version as version };
@@ -1 +1 @@
1
- import{__webpack_require__ as e}from"./rslib-runtime.js";import"./626.js";e.add({"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-beta.1/node_modules/rspack-manifest-plugin/dist/helpers.js"(e,t,s){t.transformFiles=t.reduceChunk=t.reduceAssets=t.generateManifest=void 0;let r=s("node:path?815c");t.generateManifest=(e,t,{generate:s,seed:r={}})=>s?s(r,t,Array.from(e.entrypoints.entries()).reduce((e,[t,s])=>Object.assign(e,{[t]:s.getFiles()}),{}),{compilation:e}):t.reduce((e,t)=>Object.assign(e,{[t.name]:t.path}),r),t.reduceAssets=(e,t,s)=>{let n;return(s[t.name]?n=s[t.name]:t.info.sourceFilename&&(n=(0,r.join)((0,r.dirname)(t.name),(0,r.basename)(t.info.sourceFilename))),n)?e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:n,path:t.name}):t.chunks&&t.chunks.length>0?e:e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!1,name:t.name,path:t.name})},t.reduceChunk=(e,t,s,n)=>(Array.from(t.auxiliaryFiles||[]).forEach(e=>{n[e]={isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:(0,r.basename)(e),path:e}}),Array.from(t.files).reduce((e,r)=>{let n=t.name?t.name:null;return n=n?s.useEntryKeys&&!r.endsWith(".map")?n:`${n}.${((e,{transformExtensions:t})=>{let s=e.replace(/\?.*/,"").split("."),r=s.pop();return t.test(r)?`${s.pop()}.${r}`:r})(r,s)}`:r,e.concat({chunk:t,isAsset:!1,isChunk:!0,isInitial:t.isOnlyInitial(),isModuleAsset:!1,name:n,path:r})},e));let n=e=>{let t=Object.assign({},e);return t.name=e.name.replace(/\\/g,"/"),t.path=e.path.replace(/\\/g,"/"),t};t.transformFiles=(e,t)=>["filter","map","sort"].filter(e=>!!t[e]).reduce((e,s)=>e[s](t[s]),e).map(n)},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-beta.1/node_modules/rspack-manifest-plugin/dist/hooks.js"(e,t,s){t.getCompilerHooks=t.emitHook=t.beforeRunHook=void 0;let r=s("node:fs?31c0"),n=s("node:path?815c"),o=s("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"),a=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-beta.1/node_modules/rspack-manifest-plugin/dist/helpers.js"),i=new WeakMap,l=e=>{let t=i.get(e);return void 0===t&&(t={afterEmit:new o.SyncWaterfallHook(["manifest"]),beforeEmit:new o.SyncWaterfallHook(["manifest"])},i.set(e,t)),t};t.getCompilerHooks=l,t.beforeRunHook=({emitCountMap:e,manifestFileName:t},s,r)=>{let n=e.get(t)||0;e.set(t,n+1),r&&r()},t.emitHook=function({compiler:e,emitCountMap:t,manifestAssetId:s,manifestFileName:o,moduleAssets:i,options:p},c){let h=t.get(o)-1,u=c.getStats().toJson({all:!1,assets:!0,cachedAssets:!0,ids:!0,publicPath:!0}),g=null!==p.publicPath?p.publicPath:u.publicPath,f="auto"===g?"":g,{basePath:m,removeKeyHash:d}=p;t.set(o,h);let y={},k=Array.from(c.chunks).reduce((e,t)=>(0,a.reduceChunk)(e,t,p,y),[]);(k=(k=u.assets.reduce((e,t)=>(0,a.reduceAssets)(e,t,i),k)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,n.join)(e.options.output?.path||"<unknown>",s)))).forEach(e=>{delete y[e.path]}),Object.keys(y).forEach(e=>{k=k.concat(y[e])});let S={};u.assets?.forEach(e=>{e.integrity&&(S[e.name]=e.integrity)}),k=k.map(e=>{let t=e=>e.endsWith("/")?e:`${e}/`,s={name:m?t(m)+e.name:e.name,path:f?t(f)+e.path:e.path};return S[e.path]&&(s.integrity=S[e.path]),s.name=d?s.name.replace(d,""):s.name,Object.assign(e,s)}),k=(0,a.transformFiles)(k,p);let _=(0,a.generateManifest)(c,k,p),A=0===h;if(_=l(e).beforeEmit.call(_),A){let t=p.serialize(_);c.emitAsset(s,new e.webpack.sources.RawSource(t)),p.writeToFileEmit&&((0,r.mkdirSync)((0,n.dirname)(o),{recursive:!0}),(0,r.writeFileSync)(o,t))}l(e).afterEmit.call(_)}},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-beta.1/node_modules/rspack-manifest-plugin/dist/index.js"(e,t,s){t.RspackManifestPlugin=void 0;let r=s("node:path?815c"),n=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-beta.1/node_modules/rspack-manifest-plugin/dist/hooks.js"),o=new Map,a={assetHookStage:1/0,basePath:"",fileName:"manifest.json",filter:null,generate:void 0,map:null,publicPath:null,removeKeyHash:/([a-f0-9]{16,32}\.?)/gi,seed:void 0,serialize:e=>JSON.stringify(e,null,2),sort:null,transformExtensions:/^(gz|map)$/i,useEntryKeys:!1,useLegacyEmit:!1,writeToFileEmit:!1};t.RspackManifestPlugin=class{options;constructor(e){this.options=Object.assign({},a,e)}apply(e){let t=(0,r.resolve)(e.options.output?.path||"./",this.options.fileName),s=(0,r.relative)(e.options.output?.path||"./",t),a=n.beforeRunHook.bind(this,{emitCountMap:o,manifestFileName:t}),i=n.emitHook.bind(this,{compiler:e,emitCountMap:o,manifestAssetId:s,manifestFileName:t,moduleAssets:{},options:this.options}),l={name:"WebpackManifestPlugin",stage:this.options.assetHookStage};!0===this.options.useLegacyEmit?e.hooks.emit.tap(l,i):e.hooks.thisCompilation.tap(l,e=>{e.hooks.processAssets.tap(l,()=>i(e))}),e.hooks.run.tapAsync(l,a),e.hooks.watchRun.tapAsync(l,a)}}},"../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"(e,t){var s={};s.d=(e,t,r)=>{var n=(t,r)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,[r]:t[n]})};n(t,"get"),n(r,"value")},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}s.r(r);class o{intercept(e){if(this.interceptors.push(Object.assign({},e)),e.register)for(let t=0;t<this.taps.length;t++)this.taps[t]=e.register(this.taps[t])}_runRegisterInterceptors(e){return this.interceptors.reduce((e,t)=>t.register?.(e)??e,e)}_runCallInterceptors(...e){for(let t of this.interceptors)t.call&&t.call(...e)}_runErrorInterceptors(e){for(let t of this.interceptors)t.error&&t.error(e)}_runTapInterceptors(e){for(let t of this.interceptors)t.tap&&t.tap(e)}_runDoneInterceptors(){for(let e of this.interceptors)e.done&&e.done()}_runResultInterceptors(e){for(let t of this.interceptors)t.result&&t.result(e)}withOptions(e){let t=t=>Object.assign({},e,"string"==typeof t?{name:t}:t);return{name:this.name,tap:(e,s)=>this.tap(t(e),s),tapAsync:(e,s)=>this.tapAsync(t(e),s),tapPromise:(e,s)=>this.tapPromise(t(e),s),intercept:e=>this.intercept(e),isUsed:()=>this.isUsed(),withOptions:e=>this.withOptions(t(e)),queryStageRange:e=>this.queryStageRange(e)}}isUsed(){return this.taps.length>0||this.interceptors.length>0}queryStageRange(e){return new i(e,this)}callAsyncStageRange(e){throw Error("Hook should implement there own _callAsyncStageRange")}callAsync(...e){return this.callAsyncStageRange(this.queryStageRange(a),...e)}promiseStageRange(e,...t){return new Promise((s,r)=>{this.callAsyncStageRange(e,...t,(e,t)=>e?r(e):s(t))})}promise(...e){return this.promiseStageRange(this.queryStageRange(a),...e)}tap(e,t){this._tap("sync",e,t)}tapAsync(e,t){this._tap("async",e,t)}tapPromise(e,t){this._tap("promise",e,t)}_tap(e,t,s){let r=t;if("string"==typeof t)r={name:t.trim()};else if("object"!=typeof t||null===t)throw Error("Invalid tap options");if("string"!=typeof r.name||""===r.name)throw Error("Missing name for tap");this._insert(this._runRegisterInterceptors(Object.assign({type:e,fn:s},r)))}_insert(e){let t;"string"==typeof e.before?t=new Set([e.before]):Array.isArray(e.before)&&(t=new Set(e.before));let s=0;"number"==typeof e.stage&&(s=e.stage);let r=this.taps.length;for(;r>0;){r--;let e=this.taps[r];this.taps[r+1]=e;let n=e.stage||0;if(t){if(t.has(e.name)){t.delete(e.name);continue}if(t.size>0)continue}if(!(n>s)){r++;break}}this.taps[r]=e}_prepareArgs(e){let t=this.args.length;return e.length<t?(e.length=t,e.fill(void 0,e.length,t)):(e.length>t&&(e.length=t),e)}constructor(e=[],t){n(this,"args",void 0),n(this,"name",void 0),n(this,"taps",void 0),n(this,"interceptors",void 0),this.args=e,this.name=t,this.taps=[],this.interceptors=[]}}let a=[-1/0,1/0];class i{isUsed(){return!!(this.tapsInRange.length>0||-1/0===this.stageRange[0]&&this.hook.interceptors.some(e=>e.call)||1/0===this.stageRange[1]&&this.hook.interceptors.some(e=>e.done))}call(...e){if("function"!=typeof this.hook.callStageRange)throw Error("hook is not a SyncHook, call methods only exists on SyncHook");return this.hook.callStageRange(this,...e)}callAsync(...e){return this.hook.callAsyncStageRange(this,...e)}promise(...e){return this.hook.promiseStageRange(this,...e)}constructor(e,t){n(this,"stageRange",void 0),n(this,"hook",void 0),n(this,"tapsInRange",void 0);let s=[],[r,o]=e;for(let e of t.taps){let t=e.stage??0;r<=t&&t<o?s.push(e):1/0===o&&1/0===t&&s.push(e)}this.stageRange=e,this.hook=t,this.tapsInRange=s}}class l extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){return this.callStageRange(this.queryStageRange(a),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncHook")}}class p extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){let t;this._runTapInterceptors(e);try{t=e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}if(void 0!==t)return this._runResultInterceptors(t),a(null,t)}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){return this.callStageRange(this.queryStageRange(a),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncBailHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncBailHook")}}class c extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{let t=e.fn(...i);void 0!==t&&(i[0]=t)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null,i[0]))}call(...e){return this.callStageRange(this.queryStageRange(a),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncWaterfallHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncWaterfallHook")}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}class h extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=r.length;for(let e of r){if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{0==(p-=1)&&i()},e=>{p=0,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=0,l(e)):0==(p-=1)&&i()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=0,l(e)}t||0!=--p||i()}if(p<=0)return}}}class u extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{(p+=1)===r.length?i():c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=r.length,l(e)):(p+=1)===r.length?i():c()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i():c())}if(p===r.length)return};c()}}class g extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)},p=e=>{this._runResultInterceptors(e),o(null,e)};if(0===r.length)return i();let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{c+=1,void 0!==e?p(e):c===r.length?i():h()},e=>{c=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(c=r.length,l(e)):(c+=1,void 0!==t?p(t):c===r.length?i():h())});else{let t,s=!1;try{t=e.fn(...a)}catch(e){s=!0,c=r.length,l(e)}s||(c+=1,void 0!==t?p(t):c===r.length?i():h())}if(c===r.length)return};h()}}class f extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=e=>{this._runResultInterceptors(e),o(null,e)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i(a[0]);let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{p+=1,void 0!==e&&(a[0]=e),p===r.length?i(a[0]):c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(p=r.length,l(e)):(p+=1,void 0!==t&&(a[0]=t),p===r.length?i(a[0]):c())});else{let t=!1;try{let t=e.fn(...a);void 0!==t&&(a[0]=t)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i(a[0]):c())}if(p===r.length)return};c()}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}let m=(e,t)=>t;class d{get(e){return this._map.get(e)}for(e){let t=this.get(e);if(void 0!==t)return t;let s=this._factory(e),r=this._interceptors;for(let t=0;t<r.length;t++){let n=r[t].factory;n&&(s=n(e,s))}return this._map.set(e,s),s}intercept(e){this._interceptors.push(Object.assign({factory:m},e))}isUsed(){for(let e of this._map.keys()){let t=this.get(e);if(t?.isUsed())return!0}return!1}queryStageRange(e){return new y(e,this)}constructor(e,t){n(this,"_map",new Map),n(this,"_factory",void 0),n(this,"name",void 0),n(this,"_interceptors",void 0),this.name=t,this._factory=e,this._interceptors=[]}}class y{get(e){return this.hookMap.get(e)?.queryStageRange(this.stageRange)}for(e){return this.hookMap.for(e).queryStageRange(this.stageRange)}isUsed(){for(let e of this.hookMap._map.keys())if(this.get(e)?.isUsed())return!0;return!1}constructor(e,t){n(this,"stageRange",void 0),n(this,"hookMap",void 0),this.stageRange=e,this.hookMap=t}}class k{tap(e,t){for(let s of this.hooks)s.tap(e,t)}tapAsync(e,t){for(let s of this.hooks)s.tapAsync(e,t)}tapPromise(e,t){for(let s of this.hooks)s.tapPromise(e,t)}isUsed(){for(let e of this.hooks)if(e.isUsed())return!0;return!1}intercept(e){for(let t of this.hooks)t.intercept(e)}withOptions(e){return new k(this.hooks.map(t=>t.withOptions(e)),this.name)}constructor(e,t){n(this,"hooks",void 0),n(this,"name",void 0),this.hooks=e,this.name=t}}for(var S in s.d(r,{AsyncParallelHook:()=>h,AsyncSeriesBailHook:()=>g,AsyncSeriesHook:()=>u,AsyncSeriesWaterfallHook:()=>f,HookBase:()=>o,HookMap:()=>d,MultiHook:()=>k,QueriedHook:()=>i,QueriedHookMap:()=>y,SyncBailHook:()=>p,SyncHook:()=>l,SyncWaterfallHook:()=>c},{maxStage:1/0,minStage:-1/0,safeStage:e=>e<-0x80000000?-0x80000000:e>0x7fffffff?0x7fffffff:e}),t.AsyncParallelHook=r.AsyncParallelHook,t.AsyncSeriesBailHook=r.AsyncSeriesBailHook,t.AsyncSeriesHook=r.AsyncSeriesHook,t.AsyncSeriesWaterfallHook=r.AsyncSeriesWaterfallHook,t.HookBase=r.HookBase,t.HookMap=r.HookMap,t.MultiHook=r.MultiHook,t.QueriedHook=r.QueriedHook,t.QueriedHookMap=r.QueriedHookMap,t.SyncBailHook=r.SyncBailHook,t.SyncHook=r.SyncHook,t.SyncWaterfallHook=r.SyncWaterfallHook,t.maxStage=r.maxStage,t.minStage=r.minStage,t.safeStage=r.safeStage,r)-1===["AsyncParallelHook","AsyncSeriesBailHook","AsyncSeriesHook","AsyncSeriesWaterfallHook","HookBase","HookMap","MultiHook","QueriedHook","QueriedHookMap","SyncBailHook","SyncHook","SyncWaterfallHook","maxStage","minStage","safeStage"].indexOf(S)&&(t[S]=r[S]);Object.defineProperty(t,"__esModule",{value:!0})}});var t=e("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0-beta.1/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;export{t as RspackManifestPlugin};
1
+ import{__webpack_require__ as e}from"./rslib-runtime.js";import"./626.js";e.add({"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/helpers.js"(e,t,s){t.transformFiles=t.reduceChunk=t.reduceAssets=t.generateManifest=void 0;let r=s("node:path?815c");t.generateManifest=(e,t,{generate:s,seed:r={}})=>s?s(r,t,Array.from(e.entrypoints.entries()).reduce((e,[t,s])=>Object.assign(e,{[t]:s.getFiles()}),{}),{compilation:e}):t.reduce((e,t)=>Object.assign(e,{[t.name]:t.path}),r),t.reduceAssets=(e,t,s)=>{let n;return(s[t.name]?n=s[t.name]:t.info.sourceFilename&&(n=(0,r.join)((0,r.dirname)(t.name),(0,r.basename)(t.info.sourceFilename))),n)?e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:n,path:t.name}):t.chunks&&t.chunks.length>0?e:e.concat({isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!1,name:t.name,path:t.name})},t.reduceChunk=(e,t,s,n)=>(Array.from(t.auxiliaryFiles||[]).forEach(e=>{n[e]={isAsset:!0,isChunk:!1,isInitial:!1,isModuleAsset:!0,name:(0,r.basename)(e),path:e}}),Array.from(t.files).reduce((e,r)=>{let n=t.name?t.name:null;return n=n?s.useEntryKeys&&!r.endsWith(".map")?n:`${n}.${((e,{transformExtensions:t})=>{let s=e.replace(/\?.*/,"").split("."),r=s.pop();return t.test(r)?`${s.pop()}.${r}`:r})(r,s)}`:r,e.concat({chunk:t,isAsset:!1,isChunk:!0,isInitial:t.isOnlyInitial(),isModuleAsset:!1,name:n,path:r})},e));let n=e=>{let t=Object.assign({},e);return t.name=e.name.replace(/\\/g,"/"),t.path=e.path.replace(/\\/g,"/"),t};t.transformFiles=(e,t)=>["filter","map","sort"].filter(e=>!!t[e]).reduce((e,s)=>e[s](t[s]),e).map(n)},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/hooks.js"(e,t,s){t.getCompilerHooks=t.emitHook=t.beforeRunHook=void 0;let r=s("node:fs?31c0"),n=s("node:path?815c"),o=s("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"),a=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/helpers.js"),i=new WeakMap,l=e=>{let t=i.get(e);return void 0===t&&(t={afterEmit:new o.SyncWaterfallHook(["manifest"]),beforeEmit:new o.SyncWaterfallHook(["manifest"])},i.set(e,t)),t};t.getCompilerHooks=l,t.beforeRunHook=({emitCountMap:e,manifestFileName:t},s,r)=>{let n=e.get(t)||0;e.set(t,n+1),r&&r()},t.emitHook=function({compiler:e,emitCountMap:t,manifestAssetId:s,manifestFileName:o,moduleAssets:i,options:p},c){let h=t.get(o)-1,u=c.getStats().toJson({all:!1,assets:!0,cachedAssets:!0,ids:!0,publicPath:!0}),g=null!==p.publicPath?p.publicPath:u.publicPath,f="auto"===g?"":g,{basePath:m,removeKeyHash:d}=p;t.set(o,h);let y={},k=Array.from(c.chunks).reduce((e,t)=>(0,a.reduceChunk)(e,t,p,y),[]);(k=(k=u.assets.reduce((e,t)=>(0,a.reduceAssets)(e,t,i),k)).filter(({name:s,path:r})=>!r.includes("hot-update")&&void 0===t.get((0,n.join)(e.options.output?.path||"<unknown>",s)))).forEach(e=>{delete y[e.path]}),Object.keys(y).forEach(e=>{k=k.concat(y[e])});let S={};u.assets?.forEach(e=>{e.integrity&&(S[e.name]=e.integrity)}),k=k.map(e=>{let t=e=>e.endsWith("/")?e:`${e}/`,s={name:m?t(m)+e.name:e.name,path:f?t(f)+e.path:e.path};return S[e.path]&&(s.integrity=S[e.path]),s.name=d?s.name.replace(d,""):s.name,Object.assign(e,s)}),k=(0,a.transformFiles)(k,p);let _=(0,a.generateManifest)(c,k,p),A=0===h;if(_=l(e).beforeEmit.call(_),A){let t=p.serialize(_);c.emitAsset(s,new e.webpack.sources.RawSource(t)),p.writeToFileEmit&&((0,r.mkdirSync)((0,n.dirname)(o),{recursive:!0}),(0,r.writeFileSync)(o,t))}l(e).afterEmit.call(_)}},"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/index.js"(e,t,s){t.RspackManifestPlugin=void 0;let r=s("node:path?815c"),n=s("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/hooks.js"),o=new Map,a={assetHookStage:1/0,basePath:"",fileName:"manifest.json",filter:null,generate:void 0,map:null,publicPath:null,removeKeyHash:/([a-f0-9]{16,32}\.?)/gi,seed:void 0,serialize:e=>JSON.stringify(e,null,2),sort:null,transformExtensions:/^(gz|map)$/i,useEntryKeys:!1,useLegacyEmit:!1,writeToFileEmit:!1};t.RspackManifestPlugin=class{options;constructor(e){this.options=Object.assign({},a,e)}apply(e){let t=(0,r.resolve)(e.options.output?.path||"./",this.options.fileName),s=(0,r.relative)(e.options.output?.path||"./",t),a=n.beforeRunHook.bind(this,{emitCountMap:o,manifestFileName:t}),i=n.emitHook.bind(this,{compiler:e,emitCountMap:o,manifestAssetId:s,manifestFileName:t,moduleAssets:{},options:this.options}),l={name:"WebpackManifestPlugin",stage:this.options.assetHookStage};!0===this.options.useLegacyEmit?e.hooks.emit.tap(l,i):e.hooks.thisCompilation.tap(l,e=>{e.hooks.processAssets.tap(l,()=>i(e))}),e.hooks.run.tapAsync(l,a),e.hooks.watchRun.tapAsync(l,a)}}},"../../node_modules/.pnpm/@rspack+lite-tapable@1.1.2/node_modules/@rspack/lite-tapable/dist/index.cjs"(e,t){var s={};s.d=(e,t,r)=>{var n=(t,r)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,[r]:t[n]})};n(t,"get"),n(r,"value")},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}s.r(r);class o{intercept(e){if(this.interceptors.push(Object.assign({},e)),e.register)for(let t=0;t<this.taps.length;t++)this.taps[t]=e.register(this.taps[t])}_runRegisterInterceptors(e){return this.interceptors.reduce((e,t)=>t.register?.(e)??e,e)}_runCallInterceptors(...e){for(let t of this.interceptors)t.call&&t.call(...e)}_runErrorInterceptors(e){for(let t of this.interceptors)t.error&&t.error(e)}_runTapInterceptors(e){for(let t of this.interceptors)t.tap&&t.tap(e)}_runDoneInterceptors(){for(let e of this.interceptors)e.done&&e.done()}_runResultInterceptors(e){for(let t of this.interceptors)t.result&&t.result(e)}withOptions(e){let t=t=>Object.assign({},e,"string"==typeof t?{name:t}:t);return{name:this.name,tap:(e,s)=>this.tap(t(e),s),tapAsync:(e,s)=>this.tapAsync(t(e),s),tapPromise:(e,s)=>this.tapPromise(t(e),s),intercept:e=>this.intercept(e),isUsed:()=>this.isUsed(),withOptions:e=>this.withOptions(t(e)),queryStageRange:e=>this.queryStageRange(e)}}isUsed(){return this.taps.length>0||this.interceptors.length>0}queryStageRange(e){return new i(e,this)}callAsyncStageRange(e){throw Error("Hook should implement there own _callAsyncStageRange")}callAsync(...e){return this.callAsyncStageRange(this.queryStageRange(a),...e)}promiseStageRange(e,...t){return new Promise((s,r)=>{this.callAsyncStageRange(e,...t,(e,t)=>e?r(e):s(t))})}promise(...e){return this.promiseStageRange(this.queryStageRange(a),...e)}tap(e,t){this._tap("sync",e,t)}tapAsync(e,t){this._tap("async",e,t)}tapPromise(e,t){this._tap("promise",e,t)}_tap(e,t,s){let r=t;if("string"==typeof t)r={name:t.trim()};else if("object"!=typeof t||null===t)throw Error("Invalid tap options");if("string"!=typeof r.name||""===r.name)throw Error("Missing name for tap");this._insert(this._runRegisterInterceptors(Object.assign({type:e,fn:s},r)))}_insert(e){let t;"string"==typeof e.before?t=new Set([e.before]):Array.isArray(e.before)&&(t=new Set(e.before));let s=0;"number"==typeof e.stage&&(s=e.stage);let r=this.taps.length;for(;r>0;){r--;let e=this.taps[r];this.taps[r+1]=e;let n=e.stage||0;if(t){if(t.has(e.name)){t.delete(e.name);continue}if(t.size>0)continue}if(!(n>s)){r++;break}}this.taps[r]=e}_prepareArgs(e){let t=this.args.length;return e.length<t?(e.length=t,e.fill(void 0,e.length,t)):(e.length>t&&(e.length=t),e)}constructor(e=[],t){n(this,"args",void 0),n(this,"name",void 0),n(this,"taps",void 0),n(this,"interceptors",void 0),this.args=e,this.name=t,this.taps=[],this.interceptors=[]}}let a=[-1/0,1/0];class i{isUsed(){return!!(this.tapsInRange.length>0||-1/0===this.stageRange[0]&&this.hook.interceptors.some(e=>e.call)||1/0===this.stageRange[1]&&this.hook.interceptors.some(e=>e.done))}call(...e){if("function"!=typeof this.hook.callStageRange)throw Error("hook is not a SyncHook, call methods only exists on SyncHook");return this.hook.callStageRange(this,...e)}callAsync(...e){return this.hook.callAsyncStageRange(this,...e)}promise(...e){return this.hook.promiseStageRange(this,...e)}constructor(e,t){n(this,"stageRange",void 0),n(this,"hook",void 0),n(this,"tapsInRange",void 0);let s=[],[r,o]=e;for(let e of t.taps){let t=e.stage??0;r<=t&&t<o?s.push(e):1/0===o&&1/0===t&&s.push(e)}this.stageRange=e,this.hook=t,this.tapsInRange=s}}class l extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){return this.callStageRange(this.queryStageRange(a),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncHook")}}class p extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){let t;this._runTapInterceptors(e);try{t=e.fn(...i)}catch(e){return this._runErrorInterceptors(e),a(e)}if(void 0!==t)return this._runResultInterceptors(t),a(null,t)}1/0===r&&(this._runDoneInterceptors(),a(null))}call(...e){return this.callStageRange(this.queryStageRange(a),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncBailHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncBailHook")}}class c extends o{callAsyncStageRange(e,...t){let{stageRange:[s,r],tapsInRange:n}=e,o=t.slice(0,t.length-1),a=t[t.length-1],i=this._prepareArgs(o);for(let e of(-1/0===s&&this._runCallInterceptors(...i),n)){this._runTapInterceptors(e);try{let t=e.fn(...i);void 0!==t&&(i[0]=t)}catch(e){return this._runErrorInterceptors(e),a(e)}}1/0===r&&(this._runDoneInterceptors(),a(null,i[0]))}call(...e){return this.callStageRange(this.queryStageRange(a),...e)}callStageRange(e,...t){let s,r;if(this.callAsyncStageRange(e,...t,(e,t)=>{r=e,s=t}),r)throw r;return s}tapAsync(){throw Error("tapAsync is not supported on a SyncWaterfallHook")}tapPromise(){throw Error("tapPromise is not supported on a SyncWaterfallHook")}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}class h extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=r.length;for(let e of r){if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{0==(p-=1)&&i()},e=>{p=0,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=0,l(e)):0==(p-=1)&&i()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=0,l(e)}t||0!=--p||i()}if(p<=0)return}}}class u extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i();let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(()=>{(p+=1)===r.length?i():c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,e=>{e?(p=r.length,l(e)):(p+=1)===r.length?i():c()});else{let t=!1;try{e.fn(...a)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i():c())}if(p===r.length)return};c()}}class g extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=()=>{this._runDoneInterceptors(),o(null)},l=e=>{this._runErrorInterceptors(e),o(e)},p=e=>{this._runResultInterceptors(e),o(null,e)};if(0===r.length)return i();let c=0,h=()=>{let e=r[c];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{c+=1,void 0!==e?p(e):c===r.length?i():h()},e=>{c=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(c=r.length,l(e)):(c+=1,void 0!==t?p(t):c===r.length?i():h())});else{let t,s=!1;try{t=e.fn(...a)}catch(e){s=!0,c=r.length,l(e)}s||(c+=1,void 0!==t?p(t):c===r.length?i():h())}if(c===r.length)return};h()}}class f extends o{callAsyncStageRange(e,...t){let{stageRange:[s],tapsInRange:r}=e,n=t.slice(0,t.length-1),o=t[t.length-1],a=this._prepareArgs(n);-1/0===s&&this._runCallInterceptors(...a);let i=e=>{this._runResultInterceptors(e),o(null,e)},l=e=>{this._runErrorInterceptors(e),o(e)};if(0===r.length)return i(a[0]);let p=0,c=()=>{let e=r[p];if(this._runTapInterceptors(e),"promise"===e.type){let t=e.fn(...a);if(!t||!t.then)throw Error(`Tap function (tapPromise) did not return promise (returned ${t})`);t.then(e=>{p+=1,void 0!==e&&(a[0]=e),p===r.length?i(a[0]):c()},e=>{p=r.length,l(e)})}else if("async"===e.type)e.fn(...a,(e,t)=>{e?(p=r.length,l(e)):(p+=1,void 0!==t&&(a[0]=t),p===r.length?i(a[0]):c())});else{let t=!1;try{let t=e.fn(...a);void 0!==t&&(a[0]=t)}catch(e){t=!0,p=r.length,l(e)}t||((p+=1)===r.length?i(a[0]):c())}if(p===r.length)return};c()}constructor(e=[],t){if(e.length<1)throw Error("Waterfall hooks must have at least one argument");super(e,t)}}let m=(e,t)=>t;class d{get(e){return this._map.get(e)}for(e){let t=this.get(e);if(void 0!==t)return t;let s=this._factory(e),r=this._interceptors;for(let t=0;t<r.length;t++){let n=r[t].factory;n&&(s=n(e,s))}return this._map.set(e,s),s}intercept(e){this._interceptors.push(Object.assign({factory:m},e))}isUsed(){for(let e of this._map.keys()){let t=this.get(e);if(t?.isUsed())return!0}return!1}queryStageRange(e){return new y(e,this)}constructor(e,t){n(this,"_map",new Map),n(this,"_factory",void 0),n(this,"name",void 0),n(this,"_interceptors",void 0),this.name=t,this._factory=e,this._interceptors=[]}}class y{get(e){return this.hookMap.get(e)?.queryStageRange(this.stageRange)}for(e){return this.hookMap.for(e).queryStageRange(this.stageRange)}isUsed(){for(let e of this.hookMap._map.keys())if(this.get(e)?.isUsed())return!0;return!1}constructor(e,t){n(this,"stageRange",void 0),n(this,"hookMap",void 0),this.stageRange=e,this.hookMap=t}}class k{tap(e,t){for(let s of this.hooks)s.tap(e,t)}tapAsync(e,t){for(let s of this.hooks)s.tapAsync(e,t)}tapPromise(e,t){for(let s of this.hooks)s.tapPromise(e,t)}isUsed(){for(let e of this.hooks)if(e.isUsed())return!0;return!1}intercept(e){for(let t of this.hooks)t.intercept(e)}withOptions(e){return new k(this.hooks.map(t=>t.withOptions(e)),this.name)}constructor(e,t){n(this,"hooks",void 0),n(this,"name",void 0),this.hooks=e,this.name=t}}for(var S in s.d(r,{AsyncParallelHook:()=>h,AsyncSeriesBailHook:()=>g,AsyncSeriesHook:()=>u,AsyncSeriesWaterfallHook:()=>f,HookBase:()=>o,HookMap:()=>d,MultiHook:()=>k,QueriedHook:()=>i,QueriedHookMap:()=>y,SyncBailHook:()=>p,SyncHook:()=>l,SyncWaterfallHook:()=>c},{maxStage:1/0,minStage:-1/0,safeStage:e=>e<-0x80000000?-0x80000000:e>0x7fffffff?0x7fffffff:e}),t.AsyncParallelHook=r.AsyncParallelHook,t.AsyncSeriesBailHook=r.AsyncSeriesBailHook,t.AsyncSeriesHook=r.AsyncSeriesHook,t.AsyncSeriesWaterfallHook=r.AsyncSeriesWaterfallHook,t.HookBase=r.HookBase,t.HookMap=r.HookMap,t.MultiHook=r.MultiHook,t.QueriedHook=r.QueriedHook,t.QueriedHookMap=r.QueriedHookMap,t.SyncBailHook=r.SyncBailHook,t.SyncHook=r.SyncHook,t.SyncWaterfallHook=r.SyncWaterfallHook,t.maxStage=r.maxStage,t.minStage=r.minStage,t.safeStage=r.safeStage,r)-1===["AsyncParallelHook","AsyncSeriesBailHook","AsyncSeriesHook","AsyncSeriesWaterfallHook","HookBase","HookMap","MultiHook","QueriedHook","QueriedHookMap","SyncBailHook","SyncHook","SyncWaterfallHook","maxStage","minStage","safeStage"].indexOf(S)&&(t[S]=r[S]);Object.defineProperty(t,"__esModule",{value:!0})}});var t=e("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.2.0/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;export{t as RspackManifestPlugin};
@@ -14,7 +14,6 @@ export type AssetsMiddleware = RequestHandler & {
14
14
  watch: () => void;
15
15
  close: AssetsMiddlewareClose;
16
16
  };
17
- export declare const isClientCompiler: (compiler: Compiler) => boolean;
18
17
  export declare const setupServerHooks: ({ context, compiler, token, socketServer, liveReload }: {
19
18
  context: InternalContext;
20
19
  compiler: Compiler;
@@ -1,17 +1,13 @@
1
- import type { BasicGlobalContext, BasicModuleScope, BasicRunnerFile, CompilerOptions, ModuleObject, Runner, RunnerRequirer } from './type.js';
2
- export interface IBasicRunnerOptions {
1
+ import type { BasicGlobalContext, BasicModuleScope, BasicRunnerFile, ModuleObject, Runner, RunnerFactoryOptions, RunnerRequirer } from './type.js';
2
+ export interface BasicRunnerOptions extends RunnerFactoryOptions {
3
3
  name: string;
4
- isBundleOutput: (modulePath: string) => boolean;
5
- readFileSync: (path: string) => string;
6
- dist: string;
7
- compilerOptions: CompilerOptions;
8
4
  }
9
5
  export declare abstract class BasicRunner implements Runner {
10
- protected _options: IBasicRunnerOptions;
6
+ protected _options: BasicRunnerOptions;
11
7
  protected globalContext: BasicGlobalContext | null;
12
8
  protected baseModuleScope: BasicModuleScope | null;
13
9
  protected requirers: Map<string, RunnerRequirer>;
14
- constructor(_options: IBasicRunnerOptions);
10
+ constructor(_options: BasicRunnerOptions);
15
11
  run(file: string): Promise<unknown>;
16
12
  getRequire(): RunnerRequirer;
17
13
  protected abstract createGlobalContext(): BasicGlobalContext;
@@ -35,7 +35,7 @@ export type RunnerFactoryOptions = {
35
35
  dist: string;
36
36
  compilerOptions: CompilerOptions;
37
37
  readFileSync: (path: string) => string;
38
- isBundleOutput: (modulePath: string) => boolean;
38
+ /** Whether the module path is an output file of the current compilation. */ isOutputFile: (modulePath: string) => boolean;
39
39
  };
40
40
  export interface RunnerFactory {
41
41
  create(options: RunnerFactoryOptions): Runner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "2.2.0-beta.2",
3
+ "version": "2.2.0",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -35,7 +35,7 @@
35
35
  "types.d.ts"
36
36
  ],
37
37
  "dependencies": {
38
- "@rspack/core": "~2.2.0-beta.1",
38
+ "@rspack/core": "2.2.0",
39
39
  "@swc/helpers": "^0.5.23"
40
40
  },
41
41
  "devDependencies": {