@rsbuild/core 2.1.0-beta.0 → 2.1.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,7 +1,7 @@
1
1
  import { __webpack_require__ } from "./1~rslib-runtime.js";
2
2
  import "./756.js";
3
3
  __webpack_require__.add({
4
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0-beta.0/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
4
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
5
5
  exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
6
6
  let node_path_1 = __webpack_require__("node:path?435f");
7
7
  exports.generateManifest = (compilation, files, { generate, seed = {} })=>generate ? generate(seed, files, Array.from(compilation.entrypoints.entries()).reduce((e, [name, entrypoint])=>Object.assign(e, {
@@ -61,9 +61,9 @@ __webpack_require__.add({
61
61
  'sort'
62
62
  ].filter((fname)=>!!options[fname]).reduce((prev, fname)=>prev[fname](options[fname]), files).map(standardizeFilePaths);
63
63
  },
64
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0-beta.0/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
64
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
65
65
  exports.getCompilerHooks = exports.emitHook = exports.beforeRunHook = void 0;
66
- let node_fs_1 = __webpack_require__("node:fs?9592"), node_path_1 = __webpack_require__("node:path?435f"), lite_tapable_1 = __webpack_require__("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0-beta.0/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
66
+ let node_fs_1 = __webpack_require__("node:fs?9592"), node_path_1 = __webpack_require__("node:path?435f"), lite_tapable_1 = __webpack_require__("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
67
67
  let hooks = compilerHookMap.get(compiler);
68
68
  return void 0 === hooks && (hooks = {
69
69
  afterEmit: new lite_tapable_1.SyncWaterfallHook([
@@ -112,9 +112,9 @@ __webpack_require__.add({
112
112
  getCompilerHooks(compiler).afterEmit.call(manifest);
113
113
  };
114
114
  },
115
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0-beta.0/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
115
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
116
116
  exports.RspackManifestPlugin = void 0;
117
- let node_path_1 = __webpack_require__("node:path?435f"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0-beta.0/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
117
+ let node_path_1 = __webpack_require__("node:path?435f"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
118
118
  assetHookStage: 1 / 0,
119
119
  basePath: '',
120
120
  fileName: 'manifest.json',
@@ -684,5 +684,5 @@ __webpack_require__.add({
684
684
  });
685
685
  }
686
686
  });
687
- var RspackManifestPlugin = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0-beta.0/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;
687
+ var RspackManifestPlugin = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.0/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;
688
688
  export { RspackManifestPlugin };
@@ -157,6 +157,12 @@ export type GetRsbuildConfig = {
157
157
  (type: 'original' | 'current') : Readonly<RsbuildConfig>;
158
158
  (type: 'normalized') : NormalizedConfig;
159
159
  };
160
+ export type ExposeOptions = {
161
+ /**
162
+ * Register the exposed API for a specific Rsbuild environment name (the key of `config.environments`).
163
+ * If omitted, the API is registered as global.
164
+ */ environment?: string;
165
+ };
160
166
  type PluginHook<T extends (...args: any[]) => any> = (options: T | HookDescriptor<T>) => void;
161
167
  type TransformResult = string | Buffer | {
162
168
  code: string | Buffer;
@@ -331,7 +337,7 @@ export type GetNormalizedConfig = {
331
337
  /**
332
338
  * Explicitly expose some properties or methods of the current plugin,
333
339
  * and other plugins can get these APIs through `api.useExposed`.
334
- */ expose: <T = any>(id: string | symbol, api: T) => void;
340
+ */ expose: <T = any>(id: string | symbol, api: T, options?: ExposeOptions) => void;
335
341
  /**
336
342
  * Get the Rsbuild config, this method must be called after the
337
343
  * `modifyRsbuildConfig` hook is executed.
@@ -461,6 +467,10 @@ export type GetNormalizedConfig = {
461
467
  */ transform: TransformHook;
462
468
  /**
463
469
  * Get the properties or methods exposed by other plugins.
470
+ *
471
+ * If the current plugin is registered in an environment, Rsbuild will
472
+ * first resolve the exposed API registered for the same environment,
473
+ * then fall back to the global exposed API.
464
474
  */ useExposed: <T = any>(id: string | symbol) => T | undefined;
465
475
  }>;
466
476
  export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "2.1.0-beta.0",
3
+ "version": "2.1.0",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -40,7 +40,7 @@
40
40
  "registry": "https://registry.npmjs.org/"
41
41
  },
42
42
  "dependencies": {
43
- "@rspack/core": "~2.1.0-beta.0",
43
+ "@rspack/core": "~2.1.0",
44
44
  "@swc/helpers": "^0.5.23"
45
45
  },
46
46
  "devDependencies": {
@@ -65,7 +65,7 @@
65
65
  "http-proxy-middleware": "4.1.1",
66
66
  "jiti": "^2.7.0",
67
67
  "launch-editor-middleware": "^2.14.1",
68
- "memfs": "^4.57.7",
68
+ "memfs": "^4.57.8",
69
69
  "mrmime": "^2.0.1",
70
70
  "on-finished": "2.4.1",
71
71
  "open": "^11.0.0",