@rsbuild/core 1.3.5 → 1.3.7

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,8 +1,8 @@
1
- async function transformLoader_rslib_entry_transform(source, map) {
1
+ async function transformLoader_transform(source, map) {
2
2
  var _this__compiler___rsbuildTransformer, _this__compiler;
3
3
  let callback = this.async(), bypass = ()=>callback(null, source, map), { id: transformId, getEnvironment } = this.getOptions();
4
4
  if (!transformId) return bypass();
5
- let transform = null === (_this__compiler = this._compiler) || void 0 === _this__compiler || null === (_this__compiler___rsbuildTransformer = _this__compiler.__rsbuildTransformer) || void 0 === _this__compiler___rsbuildTransformer ? void 0 : _this__compiler___rsbuildTransformer[transformId];
5
+ let transform = null == (_this__compiler = this._compiler) || null == (_this__compiler___rsbuildTransformer = _this__compiler.__rsbuildTransformer) ? void 0 : _this__compiler___rsbuildTransformer[transformId];
6
6
  if (!transform) return bypass();
7
7
  try {
8
8
  let result = await transform({
@@ -27,4 +27,4 @@ async function transformLoader_rslib_entry_transform(source, map) {
27
27
  error instanceof Error ? callback(error) : callback(Error(String(error)));
28
28
  }
29
29
  }
30
- export { transformLoader_rslib_entry_transform as default };
30
+ export { transformLoader_transform as default };
@@ -1,8 +1,8 @@
1
- let transformRawLoader_rslib_entry_ = async function(source, map) {
1
+ let transformRawLoader = async function(source, map) {
2
2
  var _this__compiler___rsbuildTransformer, _this__compiler;
3
3
  let callback = this.async(), bypass = ()=>callback(null, source, map), { id: transformId, getEnvironment } = this.getOptions();
4
4
  if (!transformId) return bypass();
5
- let transform = null === (_this__compiler = this._compiler) || void 0 === _this__compiler || null === (_this__compiler___rsbuildTransformer = _this__compiler.__rsbuildTransformer) || void 0 === _this__compiler___rsbuildTransformer ? void 0 : _this__compiler___rsbuildTransformer[transformId];
5
+ let transform = null == (_this__compiler = this._compiler) || null == (_this__compiler___rsbuildTransformer = _this__compiler.__rsbuildTransformer) ? void 0 : _this__compiler___rsbuildTransformer[transformId];
6
6
  if (!transform) return bypass();
7
7
  try {
8
8
  let result = await transform({
@@ -27,4 +27,4 @@ let transformRawLoader_rslib_entry_ = async function(source, map) {
27
27
  error instanceof Error ? callback(error) : callback(Error(String(error)));
28
28
  }
29
29
  }, raw = !0;
30
- export { transformRawLoader_rslib_entry_ as default, raw };
30
+ export { transformRawLoader as default, raw };
@@ -0,0 +1,3 @@
1
+ type Callback = (exitCode: number) => void;
2
+ export declare function exitHook(onExit: Callback): () => void;
3
+ export {};
@@ -1,7 +1,7 @@
1
1
  import type { IncomingMessage, ServerResponse } from 'node:http';
2
2
  import type { SecureServerSessionOptions } from 'node:http2';
3
3
  import type { ServerOptions as HttpsServerOptions } from 'node:https';
4
- import type { Configuration, CopyRspackPluginOptions, Externals, LightningCssMinimizerRspackPluginOptions, ModuleFederationPluginOptions, RuleSetCondition, SwcJsMinimizerRspackPluginOptions, SwcLoaderOptions, rspack } from '@rspack/core';
4
+ import type { Configuration, CopyRspackPluginOptions, Externals, LightningCssMinimizerRspackPluginOptions, ModuleFederationPluginOptions, RuleSetCondition, SwcJsMinimizerRspackPluginOptions, SwcLoaderOptions } from '@rspack/core';
5
5
  import type { ChokidarOptions } from '../../compiled/chokidar/index.js';
6
6
  import type cors from '../../compiled/cors/index.js';
7
7
  import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware/index.js';
@@ -33,7 +33,6 @@ export type ModifyRspackConfigUtils = ModifyChainUtils & {
33
33
  appendPlugins: (plugins: BundlerPluginInstance | BundlerPluginInstance[]) => void;
34
34
  removePlugin: (pluginName: string) => void;
35
35
  mergeConfig: WebpackMerge;
36
- rspack: typeof rspack;
37
36
  };
38
37
  export type ToolsRspackConfig = ConfigChainAsyncWithContext<Rspack.Configuration, ModifyRspackConfigUtils>;
39
38
  export type ToolsWebpackConfig = ConfigChainWithContext<WebpackConfig, ModifyWebpackConfigUtils>;
@@ -1,3 +1,4 @@
1
+ import type { rspack } from '@rspack/core';
1
2
  import type { ChainIdentifier } from '..';
2
3
  import type RspackChain from '../../compiled/rspack-chain';
3
4
  import type { RsbuildDevServer } from '../server/devServer';
@@ -66,7 +67,9 @@ export type OnAfterCreateCompilerFn<Compiler = Rspack.Compiler | Rspack.MultiCom
66
67
  compiler: Compiler;
67
68
  environments: Record<string, EnvironmentContext>;
68
69
  }) => MaybePromise<void>;
69
- export type OnExitFn = () => void;
70
+ export type OnExitFn = (context: {
71
+ exitCode: number;
72
+ }) => void;
70
73
  type HTMLTags = {
71
74
  headTags: HtmlBasicTag[];
72
75
  bodyTags: HtmlBasicTag[];
@@ -157,6 +160,7 @@ export type ModifyChainUtils = {
157
160
  isWebWorker: boolean;
158
161
  CHAIN_ID: ChainIdentifier;
159
162
  environment: EnvironmentContext;
163
+ rspack: typeof rspack;
160
164
  HtmlPlugin: typeof HtmlRspackPlugin;
161
165
  };
162
166
  interface PluginInstance {
@@ -1,3 +1,4 @@
1
+ /** @ts-ignore `webpack` type only exists when `@rsbuild/webpack` is installed */
1
2
  import type { RuleSetRule, Configuration as WebpackConfig, WebpackPluginInstance } from 'webpack';
2
3
  import type RspackChain from '../../compiled/rspack-chain';
3
4
  import type { ChainIdentifier } from '../configChain';
@@ -93,6 +94,7 @@ export type AsyncHook<Callback extends (...args: any[]) => T, T = any> = {
93
94
  };
94
95
  export type ModifyRspackConfigFn = (config: Rspack.Configuration, utils: ModifyRspackConfigUtils) => MaybePromise<Rspack.Configuration | void>;
95
96
  export type ModifyWebpackChainUtils = ModifyChainUtils & {
97
+ /** @ts-ignore `webpack` type only exists when `@rsbuild/webpack` is installed */
96
98
  webpack: typeof import('webpack');
97
99
  CHAIN_ID: ChainIdentifier;
98
100
  /**
@@ -1,4 +1,5 @@
1
1
  import type { CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions } from '@rspack/core';
2
+ /** @ts-ignore `webpack` type only exists when `@rsbuild/webpack` is installed */
2
3
  import type { Configuration as WebpackConfig } from 'webpack';
3
4
  import type HtmlRspackPlugin from '../../compiled/html-rspack-plugin/index.js';
4
5
  import type { AcceptedPlugin, ProcessOptions } from '../../compiled/postcss';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {
@@ -46,17 +46,17 @@
46
46
  "types.d.ts"
47
47
  ],
48
48
  "dependencies": {
49
- "@rspack/core": "1.3.3",
49
+ "@rspack/core": "1.3.5",
50
50
  "@rspack/lite-tapable": "~1.0.1",
51
- "@swc/helpers": "^0.5.15",
51
+ "@swc/helpers": "^0.5.17",
52
52
  "core-js": "~3.41.0",
53
53
  "jiti": "^2.4.2"
54
54
  },
55
55
  "devDependencies": {
56
- "@rslib/core": "0.6.1",
56
+ "@rslib/core": "0.6.3",
57
57
  "@types/connect": "3.4.38",
58
58
  "@types/cors": "^2.8.17",
59
- "@types/node": "^22.14.0",
59
+ "@types/node": "^22.14.1",
60
60
  "@types/on-finished": "2.3.4",
61
61
  "@types/webpack-bundle-analyzer": "4.7.0",
62
62
  "@types/ws": "^8.18.1",
@@ -68,7 +68,7 @@
68
68
  "cors": "^2.8.5",
69
69
  "css-loader": "7.1.2",
70
70
  "deepmerge": "^4.3.1",
71
- "dotenv": "16.4.7",
71
+ "dotenv": "16.5.0",
72
72
  "dotenv-expand": "12.0.1",
73
73
  "html-rspack-plugin": "6.0.4",
74
74
  "http-proxy-middleware": "^2.0.7",