@rsbuild/core 0.0.24 → 0.0.26

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.
Files changed (105) hide show
  1. package/bin/rsbuild.js +4 -25
  2. package/compiled/jiti/index.js +1885 -0
  3. package/compiled/jiti/license +21 -0
  4. package/compiled/jiti/package.json +1 -0
  5. package/compiled/jiti/types/jiti.d.ts +19 -0
  6. package/compiled/jiti/types/types.d.ts +31 -0
  7. package/compiled/sirv/index.js +1 -0
  8. package/compiled/sirv/package.json +1 -0
  9. package/compiled/sirv/sirv.d.ts +27 -0
  10. package/dist/cli/commands.d.ts +8 -4
  11. package/dist/cli/commands.js +49 -10
  12. package/dist/cli/config.d.ts +2 -2
  13. package/dist/cli/config.js +15 -6
  14. package/dist/cli/prepare.d.ts +1 -0
  15. package/dist/cli/{run.js → prepare.js} +19 -17
  16. package/dist/createRsbuild.d.ts +1 -2
  17. package/dist/createRsbuild.js +4 -10
  18. package/dist/index.d.ts +9 -4
  19. package/dist/index.js +2 -4
  20. package/dist/plugins/asset.d.ts +2 -2
  21. package/dist/plugins/bundleAnalyzer.d.ts +2 -2
  22. package/dist/plugins/cache.d.ts +2 -2
  23. package/dist/plugins/cache.js +0 -3
  24. package/dist/plugins/cleanOutput.d.ts +2 -2
  25. package/dist/plugins/define.d.ts +2 -2
  26. package/dist/plugins/devtool.d.ts +2 -2
  27. package/dist/plugins/entry.d.ts +1 -1
  28. package/dist/plugins/externals.d.ts +2 -2
  29. package/dist/plugins/fileSize.d.ts +2 -2
  30. package/dist/plugins/fileSize.js +2 -2
  31. package/dist/plugins/html.d.ts +3 -2
  32. package/dist/plugins/inlineChunk.d.ts +2 -2
  33. package/dist/plugins/moment.d.ts +2 -2
  34. package/dist/plugins/networkPerformance.d.ts +2 -2
  35. package/dist/plugins/nodeAddons.d.ts +2 -2
  36. package/dist/plugins/performance.d.ts +2 -2
  37. package/dist/plugins/preloadOrPrefetch.d.ts +2 -2
  38. package/dist/plugins/splitChunks.d.ts +2 -2
  39. package/dist/plugins/startUrl.d.ts +2 -2
  40. package/dist/plugins/target.d.ts +2 -2
  41. package/dist/plugins/toml.d.ts +2 -2
  42. package/dist/plugins/wasm.d.ts +2 -2
  43. package/dist/plugins/yaml.d.ts +2 -2
  44. package/dist/{rspack-provider/rspackPlugin/removeCssSourcemapPlugin.js → rspack-plugins/RemoveCssSourcemapPlugin.js} +3 -3
  45. package/dist/rspack-provider/config.d.ts +9 -0
  46. package/dist/rspack-provider/{config/defaults.js → config.js} +9 -3
  47. package/dist/rspack-provider/core/createCompiler.d.ts +1 -1
  48. package/dist/rspack-provider/core/createContext.d.ts +8 -2
  49. package/dist/rspack-provider/core/createContext.js +90 -5
  50. package/dist/rspack-provider/core/initConfigs.d.ts +1 -1
  51. package/dist/rspack-provider/core/initConfigs.js +4 -3
  52. package/dist/rspack-provider/core/initHooks.d.ts +2 -2
  53. package/dist/rspack-provider/core/initPlugins.d.ts +1 -1
  54. package/dist/rspack-provider/core/initPlugins.js +2 -1
  55. package/dist/rspack-provider/core/rspackConfig.d.ts +1 -1
  56. package/dist/rspack-provider/index.d.ts +3 -3
  57. package/dist/rspack-provider/index.js +11 -4
  58. package/dist/rspack-provider/plugins/basic.d.ts +1 -1
  59. package/dist/rspack-provider/plugins/css.d.ts +1 -1
  60. package/dist/rspack-provider/plugins/css.js +3 -11
  61. package/dist/rspack-provider/plugins/hmr.d.ts +1 -1
  62. package/dist/rspack-provider/plugins/less.d.ts +1 -1
  63. package/dist/rspack-provider/plugins/minimize.d.ts +1 -1
  64. package/dist/rspack-provider/plugins/output.d.ts +1 -1
  65. package/dist/rspack-provider/plugins/progress.d.ts +1 -1
  66. package/dist/rspack-provider/plugins/resolve.d.ts +1 -1
  67. package/dist/rspack-provider/plugins/rspackProfile.d.ts +1 -1
  68. package/dist/rspack-provider/plugins/sass.d.ts +1 -1
  69. package/dist/rspack-provider/plugins/swc.d.ts +1 -1
  70. package/dist/rspack-provider/plugins/transition.d.ts +1 -1
  71. package/dist/rspack-provider/provider.d.ts +1 -1
  72. package/dist/rspack-provider/provider.js +5 -6
  73. package/dist/rspack-provider/shared.d.ts +8 -0
  74. package/dist/rspack-provider/shared.js +116 -0
  75. package/dist/server/prodServer.js +1 -1
  76. package/dist/server/restart.js +2 -4
  77. package/dist/types.d.ts +19 -0
  78. package/dist/{rspack-provider/types/plugin.js → types.js} +2 -2
  79. package/package.json +5 -7
  80. package/dist/cli/index.d.ts +0 -2
  81. package/dist/cli/index.js +0 -31
  82. package/dist/cli/run.d.ts +0 -5
  83. package/dist/rspack-provider/config/defaults.d.ts +0 -3
  84. package/dist/rspack-provider/config/normalize.d.ts +0 -7
  85. package/dist/rspack-provider/config/normalize.js +0 -33
  86. package/dist/rspack-provider/shared/constants.d.ts +0 -1
  87. package/dist/rspack-provider/shared/constants.js +0 -28
  88. package/dist/rspack-provider/shared/fs.d.ts +0 -1
  89. package/dist/rspack-provider/shared/fs.js +0 -38
  90. package/dist/rspack-provider/shared/index.d.ts +0 -3
  91. package/dist/rspack-provider/shared/index.js +0 -26
  92. package/dist/rspack-provider/shared/plugin.d.ts +0 -3
  93. package/dist/rspack-provider/shared/plugin.js +0 -75
  94. package/dist/rspack-provider/shared/rspackVersion.d.ts +0 -3
  95. package/dist/rspack-provider/shared/rspackVersion.js +0 -61
  96. package/dist/rspack-provider/types/context.d.ts +0 -16
  97. package/dist/rspack-provider/types/context.js +0 -16
  98. package/dist/rspack-provider/types/index.d.ts +0 -3
  99. package/dist/rspack-provider/types/index.js +0 -24
  100. package/dist/rspack-provider/types/plugin.d.ts +0 -4
  101. /package/dist/{rspack-provider/rspackPlugin/removeCssSourcemapPlugin.d.ts → rspack-plugins/RemoveCssSourcemapPlugin.d.ts} +0 -0
  102. /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/index.d.ts +0 -0
  103. /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/index.js +0 -0
  104. /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/postcss-icss-extract-plugin.d.ts +0 -0
  105. /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/postcss-icss-extract-plugin.js +0 -0
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(prodServer_exports);
35
35
  var import_http = require("http");
36
36
  var import_connect = __toESM(require("@rsbuild/shared/connect"));
37
37
  var import_path = require("path");
38
- var import_sirv = __toESM(require("sirv"));
38
+ var import_sirv = __toESM(require("../../compiled/sirv"));
39
39
  var import_shared = require("@rsbuild/shared");
40
40
  var import_middlewares = require("./middlewares");
41
41
  class RsbuildProdServer {
@@ -34,7 +34,7 @@ __export(restart_exports, {
34
34
  module.exports = __toCommonJS(restart_exports);
35
35
  var import_path = __toESM(require("path"));
36
36
  var import_shared = require("@rsbuild/shared");
37
- var import_run = require("../cli/run");
37
+ var import_commands = require("../cli/commands");
38
38
  const cleaners = [];
39
39
  const registerCleaner = (cleaner) => {
40
40
  cleaners.push(cleaner);
@@ -52,9 +52,7 @@ const restartDevServer = async ({ filePath }) => {
52
52
  for (const cleaner of cleaners) {
53
53
  await cleaner();
54
54
  }
55
- const rsbuild = await (0, import_run.runCli)({
56
- isRestart: true
57
- });
55
+ const rsbuild = await (0, import_commands.init)();
58
56
  await rsbuild.startDevServer();
59
57
  };
60
58
  // Annotate the CommonJS export names for ESM import in node:
@@ -0,0 +1,19 @@
1
+ import type { Context as BaseContext, RsbuildConfig, NormalizedConfig, DefaultRsbuildPluginAPI, RsbuildPlugin as BaseRsbuildPlugin } from '@rsbuild/shared';
2
+ import type { Hooks } from './rspack-provider/core/initHooks';
3
+ import type { RspackConfig, RspackCompiler, RspackMultiCompiler } from '@rsbuild/shared';
4
+ export interface RsbuildPluginAPI extends DefaultRsbuildPluginAPI<RsbuildConfig, NormalizedConfig, RspackConfig, RspackCompiler | RspackMultiCompiler> {}
5
+ export type RsbuildPlugin<T = RsbuildPluginAPI> = BaseRsbuildPlugin<T>;
6
+ /** The inner context. */
7
+ export type Context = BaseContext & {
8
+ /** All hooks. */
9
+ hooks: Readonly<Hooks>;
10
+ /** Current Rsbuild config. */
11
+ config: Readonly<RsbuildConfig>;
12
+ /** The original Rsbuild config passed from the createRsbuild method. */
13
+ originalConfig: Readonly<RsbuildConfig>;
14
+ /** The normalized Rsbuild config. */
15
+ normalizedConfig?: NormalizedConfig;
16
+ /** The plugin API. */
17
+ pluginAPI?: RsbuildPluginAPI;
18
+ };
19
+ export type { RsbuildConfig, NormalizedConfig, DevConfig, HtmlConfig, ToolsConfig, SourceConfig, OutputConfig, SecurityConfig, PerformanceConfig, NormalizedDevConfig, NormalizedHtmlConfig, NormalizedToolsConfig, NormalizedSourceConfig, NormalizedOutputConfig, NormalizedSecurityConfig, NormalizedPerformanceConfig } from '@rsbuild/shared';
@@ -12,5 +12,5 @@ var __copyProps = (to, from, except, desc) => {
12
12
  return to;
13
13
  };
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var plugin_exports = {};
16
- module.exports = __toCommonJS(plugin_exports);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "Unleash the power of Rspack with the out-of-the-box build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {
@@ -26,8 +26,8 @@
26
26
  "default": "./dist/client/*.js"
27
27
  },
28
28
  "./cli": {
29
- "types": "./dist/cli/index.d.ts",
30
- "default": "./dist/cli/index.js"
29
+ "types": "./dist/cli/commands.d.ts",
30
+ "default": "./dist/cli/commands.js"
31
31
  },
32
32
  "./plugins/*": {
33
33
  "types": "./dist/plugins/*.d.ts",
@@ -58,16 +58,14 @@
58
58
  "types.d.ts"
59
59
  ],
60
60
  "dependencies": {
61
- "@rspack/core": "0.3.13",
61
+ "@rspack/core": "0.3.14",
62
62
  "core-js": "~3.32.2",
63
63
  "html-webpack-plugin": "npm:html-rspack-plugin@5.5.5",
64
64
  "http-proxy-middleware": "^2.0.1",
65
- "jiti": "^1.20.0",
66
65
  "postcss": "8.4.31",
67
66
  "semver": "^7.5.4",
68
- "sirv": "^2.0.3",
69
67
  "ws": "^8.2.0",
70
- "@rsbuild/shared": "0.0.24"
68
+ "@rsbuild/shared": "0.0.26"
71
69
  },
72
70
  "devDependencies": {
73
71
  "@types/node": "^16",
@@ -1,2 +0,0 @@
1
- export { defineConfig } from './config';
2
- export { runCli } from './run';
package/dist/cli/index.js DELETED
@@ -1,31 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var cli_exports = {};
20
- __export(cli_exports, {
21
- defineConfig: () => import_config.defineConfig,
22
- runCli: () => import_run.runCli
23
- });
24
- module.exports = __toCommonJS(cli_exports);
25
- var import_config = require("./config");
26
- var import_run = require("./run");
27
- // Annotate the CommonJS export names for ESM import in node:
28
- 0 && (module.exports = {
29
- defineConfig,
30
- runCli
31
- });
package/dist/cli/run.d.ts DELETED
@@ -1,5 +0,0 @@
1
- type RunCliOptions = {
2
- isRestart?: boolean;
3
- };
4
- export declare function runCli(options?: RunCliOptions): Promise<import("..").RsbuildInstance<any>>;
5
- export {};
@@ -1,3 +0,0 @@
1
- import type { RsbuildConfig } from '../types';
2
- export declare const createDefaultConfig: () => RsbuildConfig;
3
- export declare const withDefaultConfig: (config: RsbuildConfig) => RsbuildConfig;
@@ -1,7 +0,0 @@
1
- import { RsbuildConfig, NormalizedConfig } from '../types';
2
- /** #__PURE__
3
- * 1. May used by multiple plugins.
4
- * 2. Object value that should not be empty.
5
- * 3. Meaningful and can be filled by constant value.
6
- */
7
- export declare const normalizeConfig: (config: RsbuildConfig) => NormalizedConfig;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var normalize_exports = {};
20
- __export(normalize_exports, {
21
- normalizeConfig: () => normalizeConfig
22
- });
23
- module.exports = __toCommonJS(normalize_exports);
24
- var import_shared = require("@rsbuild/shared");
25
- var import_defaults = require("./defaults");
26
- const normalizeConfig = (config) => (0, import_shared.mergeRsbuildConfig)(
27
- (0, import_defaults.createDefaultConfig)(),
28
- config
29
- );
30
- // Annotate the CommonJS export names for ESM import in node:
31
- 0 && (module.exports = {
32
- normalizeConfig
33
- });
@@ -1 +0,0 @@
1
- export declare const BUILTIN_LOADER = "builtin:";
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var constants_exports = {};
20
- __export(constants_exports, {
21
- BUILTIN_LOADER: () => BUILTIN_LOADER
22
- });
23
- module.exports = __toCommonJS(constants_exports);
24
- const BUILTIN_LOADER = "builtin:";
25
- // Annotate the CommonJS export names for ESM import in node:
26
- 0 && (module.exports = {
27
- BUILTIN_LOADER
28
- });
@@ -1 +0,0 @@
1
- export declare const getCompiledPath: (packageName: string) => string;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var fs_exports = {};
20
- __export(fs_exports, {
21
- getCompiledPath: () => getCompiledPath
22
- });
23
- module.exports = __toCommonJS(fs_exports);
24
- var import_path = require("path");
25
- var import_shared = require("@rsbuild/shared");
26
- var import_shared2 = require("@rsbuild/shared");
27
- const getCompiledPath = (packageName) => {
28
- const providerCompilerPath = (0, import_path.join)(__dirname, "../../compiled", packageName);
29
- if (import_shared2.fse.existsSync(providerCompilerPath)) {
30
- return providerCompilerPath;
31
- } else {
32
- return (0, import_shared.getSharedPkgCompiledPath)(packageName);
33
- }
34
- };
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- getCompiledPath
38
- });
@@ -1,3 +0,0 @@
1
- export * from './fs';
2
- export * from './constants';
3
- export * from './rspackVersion';
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var shared_exports = {};
17
- module.exports = __toCommonJS(shared_exports);
18
- __reExport(shared_exports, require("./fs"), module.exports);
19
- __reExport(shared_exports, require("./constants"), module.exports);
20
- __reExport(shared_exports, require("./rspackVersion"), module.exports);
21
- // Annotate the CommonJS export names for ESM import in node:
22
- 0 && (module.exports = {
23
- ...require("./fs"),
24
- ...require("./constants"),
25
- ...require("./rspackVersion")
26
- });
@@ -1,3 +0,0 @@
1
- import { RsbuildPlugin } from '../types';
2
- import { Plugins } from '@rsbuild/shared';
3
- export declare const applyDefaultPlugins: (plugins: Plugins) => import("@rsbuild/shared").AwaitableGetter<RsbuildPlugin>;
@@ -1,75 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var plugin_exports = {};
30
- __export(plugin_exports, {
31
- applyDefaultPlugins: () => applyDefaultPlugins
32
- });
33
- module.exports = __toCommonJS(plugin_exports);
34
- var import_shared = require("@rsbuild/shared");
35
- const applyDefaultPlugins = (plugins) => (0, import_shared.awaitableGetter)([
36
- Promise.resolve().then(() => __toESM(require("../plugins/transition"))).then((m) => m.pluginTransition()),
37
- Promise.resolve().then(() => __toESM(require("../plugins/basic"))).then((m) => m.pluginBasic()),
38
- plugins.entry(),
39
- // plugins.cache(),
40
- plugins.target(),
41
- Promise.resolve().then(() => __toESM(require("../plugins/output"))).then((m) => m.pluginOutput()),
42
- plugins.devtool(),
43
- Promise.resolve().then(() => __toESM(require("../plugins/resolve"))).then((m) => m.pluginResolve()),
44
- plugins.fileSize(),
45
- // cleanOutput plugin should before the html plugin
46
- plugins.cleanOutput(),
47
- plugins.asset(),
48
- plugins.html(),
49
- plugins.wasm(),
50
- plugins.moment(),
51
- plugins.nodeAddons(),
52
- plugins.define(),
53
- Promise.resolve().then(() => __toESM(require("../plugins/css"))).then((m) => m.pluginCss()),
54
- Promise.resolve().then(() => __toESM(require("../plugins/less"))).then((m) => m.pluginLess()),
55
- Promise.resolve().then(() => __toESM(require("../plugins/sass"))).then((m) => m.pluginSass()),
56
- Promise.resolve().then(() => __toESM(require("../plugins/minimize"))).then((m) => m.pluginMinimize()),
57
- Promise.resolve().then(() => __toESM(require("../plugins/hmr"))).then((m) => m.pluginHMR()),
58
- Promise.resolve().then(() => __toESM(require("../plugins/progress"))).then((m) => m.pluginProgress()),
59
- Promise.resolve().then(() => __toESM(require("../plugins/swc"))).then((m) => m.pluginSwc()),
60
- plugins.externals(),
61
- plugins.toml(),
62
- plugins.yaml(),
63
- plugins.splitChunks(),
64
- plugins.startUrl(),
65
- plugins.inlineChunk(),
66
- plugins.bundleAnalyzer(),
67
- plugins.networkPerformance(),
68
- plugins.preloadOrPrefetch(),
69
- plugins.performance(),
70
- Promise.resolve().then(() => __toESM(require("../plugins/rspackProfile"))).then((m) => m.pluginRspackProfile())
71
- ]);
72
- // Annotate the CommonJS export names for ESM import in node:
73
- 0 && (module.exports = {
74
- applyDefaultPlugins
75
- });
@@ -1,3 +0,0 @@
1
- export declare const getRspackVersion: () => Promise<string>;
2
- export declare const supportedRspackMinimumVersion = "0.3.6";
3
- export declare const isSatisfyRspackMinimumVersion: (customVersion?: string) => Promise<boolean>;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var rspackVersion_exports = {};
30
- __export(rspackVersion_exports, {
31
- getRspackVersion: () => getRspackVersion,
32
- isSatisfyRspackMinimumVersion: () => isSatisfyRspackMinimumVersion,
33
- supportedRspackMinimumVersion: () => supportedRspackMinimumVersion
34
- });
35
- module.exports = __toCommonJS(rspackVersion_exports);
36
- var import_path = __toESM(require("path"));
37
- const getRspackVersion = async () => {
38
- try {
39
- const core = require.resolve("@rspack/core");
40
- const pkg = await Promise.resolve().then(() => __toESM(require(import_path.default.join(core, "../../package.json"))));
41
- return pkg == null ? void 0 : pkg.version;
42
- } catch (err) {
43
- console.error(err);
44
- return "";
45
- }
46
- };
47
- const supportedRspackMinimumVersion = "0.3.6";
48
- const isSatisfyRspackMinimumVersion = async (customVersion) => {
49
- let version = customVersion || await getRspackVersion();
50
- const semver = await Promise.resolve().then(() => __toESM(require("semver")));
51
- if (version.includes("-canary")) {
52
- version = version.split("-canary")[0];
53
- }
54
- return version ? semver.lte(supportedRspackMinimumVersion, version) : true;
55
- };
56
- // Annotate the CommonJS export names for ESM import in node:
57
- 0 && (module.exports = {
58
- getRspackVersion,
59
- isSatisfyRspackMinimumVersion,
60
- supportedRspackMinimumVersion
61
- });
@@ -1,16 +0,0 @@
1
- import type { Context as BaseContext, RsbuildConfig, NormalizedConfig } from '@rsbuild/shared';
2
- import type { Hooks } from '../core/initHooks';
3
- import type { RsbuildPluginAPI } from './plugin';
4
- /** The inner context. */
5
- export type Context = BaseContext & {
6
- /** All hooks. */
7
- hooks: Readonly<Hooks>;
8
- /** Current Rsbuild config. */
9
- config: Readonly<RsbuildConfig>;
10
- /** The original Rsbuild config passed from the createRsbuild method. */
11
- originalConfig: Readonly<RsbuildConfig>;
12
- /** The normalized Rsbuild config. */
13
- normalizedConfig?: NormalizedConfig;
14
- /** The plugin API. */
15
- pluginAPI?: RsbuildPluginAPI;
16
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var context_exports = {};
16
- module.exports = __toCommonJS(context_exports);
@@ -1,3 +0,0 @@
1
- export * from './plugin';
2
- export * from './context';
3
- export type { RsbuildConfig, NormalizedConfig, DevConfig, HtmlConfig, ToolsConfig, SourceConfig, OutputConfig, SecurityConfig, PerformanceConfig, NormalizedDevConfig, NormalizedHtmlConfig, NormalizedToolsConfig, NormalizedSourceConfig, NormalizedOutputConfig, NormalizedSecurityConfig, NormalizedPerformanceConfig } from '@rsbuild/shared';
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var types_exports = {};
17
- module.exports = __toCommonJS(types_exports);
18
- __reExport(types_exports, require("./plugin"), module.exports);
19
- __reExport(types_exports, require("./context"), module.exports);
20
- // Annotate the CommonJS export names for ESM import in node:
21
- 0 && (module.exports = {
22
- ...require("./plugin"),
23
- ...require("./context")
24
- });
@@ -1,4 +0,0 @@
1
- import type { RsbuildConfig, NormalizedConfig, DefaultRsbuildPluginAPI, RsbuildPlugin as BaseRsbuildPlugin } from '@rsbuild/shared';
2
- import type { RspackConfig, RspackCompiler, RspackMultiCompiler } from '@rsbuild/shared';
3
- export interface RsbuildPluginAPI extends DefaultRsbuildPluginAPI<RsbuildConfig, NormalizedConfig, RspackConfig, RspackCompiler | RspackMultiCompiler> {}
4
- export type RsbuildPlugin<T = RsbuildPluginAPI> = BaseRsbuildPlugin<T>;