@rsbuild/core 0.0.25 → 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 (54) 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 +0 -1
  17. package/dist/createRsbuild.js +4 -9
  18. package/dist/index.d.ts +7 -3
  19. package/dist/index.js +2 -4
  20. package/dist/rspack-provider/config.d.ts +9 -0
  21. package/dist/rspack-provider/{config/defaults.js → config.js} +9 -3
  22. package/dist/rspack-provider/core/createContext.d.ts +8 -2
  23. package/dist/rspack-provider/core/createContext.js +90 -5
  24. package/dist/rspack-provider/core/initConfigs.js +4 -3
  25. package/dist/rspack-provider/core/initPlugins.js +2 -1
  26. package/dist/rspack-provider/index.d.ts +3 -2
  27. package/dist/rspack-provider/index.js +11 -4
  28. package/dist/rspack-provider/plugins/css.js +2 -10
  29. package/dist/rspack-provider/provider.js +5 -6
  30. package/dist/rspack-provider/shared.d.ts +8 -0
  31. package/dist/rspack-provider/shared.js +116 -0
  32. package/dist/server/prodServer.js +1 -1
  33. package/dist/server/restart.js +2 -4
  34. package/package.json +4 -6
  35. package/dist/cli/index.d.ts +0 -2
  36. package/dist/cli/index.js +0 -31
  37. package/dist/cli/run.d.ts +0 -5
  38. package/dist/rspack-provider/config/defaults.d.ts +0 -3
  39. package/dist/rspack-provider/config/normalize.d.ts +0 -7
  40. package/dist/rspack-provider/config/normalize.js +0 -33
  41. package/dist/rspack-provider/shared/constants.d.ts +0 -1
  42. package/dist/rspack-provider/shared/constants.js +0 -28
  43. package/dist/rspack-provider/shared/fs.d.ts +0 -1
  44. package/dist/rspack-provider/shared/fs.js +0 -38
  45. package/dist/rspack-provider/shared/index.d.ts +0 -3
  46. package/dist/rspack-provider/shared/index.js +0 -26
  47. package/dist/rspack-provider/shared/plugin.d.ts +0 -3
  48. package/dist/rspack-provider/shared/plugin.js +0 -75
  49. package/dist/rspack-provider/shared/rspackVersion.d.ts +0 -3
  50. package/dist/rspack-provider/shared/rspackVersion.js +0 -61
  51. /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/index.d.ts +0 -0
  52. /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/index.js +0 -0
  53. /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/postcss-icss-extract-plugin.d.ts +0 -0
  54. /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/postcss-icss-extract-plugin.js +0 -0
@@ -22,9 +22,10 @@ __export(initConfigs_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(initConfigs_exports);
24
24
  var import_shared = require("@rsbuild/shared");
25
+ var import_createContext = require("./createContext");
25
26
  var import_inspectConfig = require("./inspectConfig");
26
27
  var import_rspackConfig = require("./rspackConfig");
27
- var import_normalize = require("../config/normalize");
28
+ var import_config = require("../config");
28
29
  async function modifyRsbuildConfig(context) {
29
30
  (0, import_shared.debug)("modify Rsbuild config");
30
31
  const [modified] = await context.hooks.modifyRsbuildConfigHook.call(
@@ -44,8 +45,8 @@ async function initConfigs({
44
45
  pluginStore
45
46
  });
46
47
  await modifyRsbuildConfig(context);
47
- context.normalizedConfig = (0, import_normalize.normalizeConfig)(context.config);
48
- (0, import_shared.updateContextByNormalizedConfig)(context, context.normalizedConfig);
48
+ context.normalizedConfig = (0, import_config.normalizeConfig)(context.config);
49
+ (0, import_createContext.updateContextByNormalizedConfig)(context, context.normalizedConfig);
49
50
  const targets = (0, import_shared.castArray)(rsbuildOptions.target);
50
51
  const rspackConfigs = await Promise.all(
51
52
  targets.map((target) => (0, import_rspackConfig.generateRspackConfig)({ target, context }))
@@ -22,12 +22,13 @@ __export(initPlugins_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(initPlugins_exports);
24
24
  var import_shared = require("@rsbuild/shared");
25
+ var import_createContext = require("./createContext");
25
26
  function getPluginAPI({
26
27
  context,
27
28
  pluginStore
28
29
  }) {
29
30
  const { hooks } = context;
30
- const publicContext = (0, import_shared.createPublicContext)(context);
31
+ const publicContext = (0, import_createContext.createPublicContext)(context);
31
32
  const getRsbuildConfig = () => {
32
33
  if (!context.normalizedConfig) {
33
34
  throw new Error(
@@ -1,4 +1,5 @@
1
- export { getRspackVersion } from './shared/rspackVersion';
1
+ export { getRspackVersion } from './shared';
2
2
  export { rspackProvider } from './provider';
3
3
  export type { RspackProvider } from './provider';
4
- export type { Rspack, RspackConfig } from '@rsbuild/shared';
4
+ export type { Rspack, RspackConfig } from '@rsbuild/shared';
5
+ export { createPublicContext, createContextByConfig, updateContextByNormalizedConfig } from './core/createContext';
@@ -18,14 +18,21 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var rspack_provider_exports = {};
20
20
  __export(rspack_provider_exports, {
21
- getRspackVersion: () => import_rspackVersion.getRspackVersion,
22
- rspackProvider: () => import_provider.rspackProvider
21
+ createContextByConfig: () => import_createContext.createContextByConfig,
22
+ createPublicContext: () => import_createContext.createPublicContext,
23
+ getRspackVersion: () => import_shared.getRspackVersion,
24
+ rspackProvider: () => import_provider.rspackProvider,
25
+ updateContextByNormalizedConfig: () => import_createContext.updateContextByNormalizedConfig
23
26
  });
24
27
  module.exports = __toCommonJS(rspack_provider_exports);
25
- var import_rspackVersion = require("./shared/rspackVersion");
28
+ var import_shared = require("./shared");
26
29
  var import_provider = require("./provider");
30
+ var import_createContext = require("./core/createContext");
27
31
  // Annotate the CommonJS export names for ESM import in node:
28
32
  0 && (module.exports = {
33
+ createContextByConfig,
34
+ createPublicContext,
29
35
  getRspackVersion,
30
- rspackProvider
36
+ rspackProvider,
37
+ updateContextByNormalizedConfig
31
38
  });
@@ -45,7 +45,6 @@ async function applyBaseCSSRule({
45
45
  utils: { target, isProd, isServer, isWebWorker, CHAIN_ID },
46
46
  importLoaders = 1
47
47
  }) {
48
- const enableExtractCSS = (0, import_shared.isUseCssExtract)(config, target);
49
48
  const enableSourceMap = (0, import_shared.isUseCssSourceMap)(config);
50
49
  const enableCSSModuleTS = Boolean(config.output.enableCssModuleTSDeclaration);
51
50
  const browserslist = await (0, import_shared.getBrowserslistWithDefault)(
@@ -53,7 +52,6 @@ async function applyBaseCSSRule({
53
52
  config,
54
53
  target
55
54
  );
56
- const enableCssMinify = !enableExtractCSS && isProd;
57
55
  if (!enableNativeCss(config)) {
58
56
  const localIdentName = (0, import_shared.getCssModuleLocalIdentName)(config, isProd);
59
57
  const cssLoaderOptions = (0, import_shared.getCssLoaderOptions)({
@@ -91,12 +89,7 @@ async function applyBaseCSSRule({
91
89
  } else {
92
90
  if (!isServer && !isWebWorker && enableCSSModuleTS) {
93
91
  const { cssModules } = config.output;
94
- rule.use(CHAIN_ID.USE.CSS_MODULES_TS).loader(
95
- import_path.default.resolve(
96
- __dirname,
97
- "../rspackLoader/css-modules-typescript-pre-loader"
98
- )
99
- ).options({
92
+ rule.use(CHAIN_ID.USE.CSS_MODULES_TS).loader(import_path.default.resolve(__dirname, "../css-modules-typescript-pre-loader")).options({
100
93
  modules: {
101
94
  exportLocalsConvention: cssModules.exportLocalsConvention,
102
95
  auto: cssModules.auto
@@ -109,8 +102,7 @@ async function applyBaseCSSRule({
109
102
  const postcssLoaderOptions = (0, import_shared.getPostcssConfig)({
110
103
  enableSourceMap,
111
104
  browserslist,
112
- config,
113
- enableCssMinify
105
+ config
114
106
  });
115
107
  rule.use(CHAIN_ID.USE.POSTCSS).loader((0, import_shared2.getCompiledPath)("postcss-loader")).options(postcssLoaderOptions).end();
116
108
  }
@@ -35,17 +35,16 @@ var import_shared = require("@rsbuild/shared");
35
35
  var import_createContext = require("./core/createContext");
36
36
  var import_initConfigs = require("./core/initConfigs");
37
37
  var import_initPlugins = require("./core/initPlugins");
38
- var import_plugin = require("./shared/plugin");
39
- var import_rspackVersion = require("./shared/rspackVersion");
38
+ var import_shared2 = require("./shared");
40
39
  function rspackProvider({
41
40
  rsbuildConfig: originalRsbuildConfig
42
41
  }) {
43
42
  const rsbuildConfig = (0, import_shared.pickRsbuildConfig)(originalRsbuildConfig);
44
43
  return async ({ pluginStore, rsbuildOptions, plugins }) => {
45
- if (!await (0, import_rspackVersion.isSatisfyRspackMinimumVersion)()) {
44
+ if (!await (0, import_shared2.isSatisfyRspackMinimumVersion)()) {
46
45
  throw new Error(
47
46
  `The current Rspack version does not meet the requirements, the minimum supported version of Rspack is ${import_shared.color.green(
48
- import_rspackVersion.supportedRspackMinimumVersion
47
+ import_shared2.supportedRspackMinimumVersion
49
48
  )}`
50
49
  );
51
50
  }
@@ -55,9 +54,9 @@ function rspackProvider({
55
54
  return {
56
55
  bundler: "rspack",
57
56
  pluginAPI,
58
- publicContext: (0, import_shared.createPublicContext)(context),
57
+ publicContext: (0, import_createContext.createPublicContext)(context),
59
58
  async applyDefaultPlugins() {
60
- pluginStore.addPlugins(await (0, import_plugin.applyDefaultPlugins)(plugins));
59
+ pluginStore.addPlugins(await (0, import_shared2.applyDefaultPlugins)(plugins));
61
60
  },
62
61
  async createCompiler() {
63
62
  const { createCompiler } = await Promise.resolve().then(() => __toESM(require("./core/createCompiler")));
@@ -0,0 +1,8 @@
1
+ import { RsbuildPlugin } from '../types';
2
+ import { Plugins } from '@rsbuild/shared';
3
+ export declare const applyDefaultPlugins: (plugins: Plugins) => import("@rsbuild/shared").AwaitableGetter<RsbuildPlugin>;
4
+ export declare const getRspackVersion: () => Promise<string>;
5
+ export declare const supportedRspackMinimumVersion = "0.3.6";
6
+ export declare const isSatisfyRspackMinimumVersion: (customVersion?: string) => Promise<boolean>;
7
+ export declare const getCompiledPath: (packageName: string) => string;
8
+ export declare const BUILTIN_LOADER = "builtin:";
@@ -0,0 +1,116 @@
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 shared_exports = {};
30
+ __export(shared_exports, {
31
+ BUILTIN_LOADER: () => BUILTIN_LOADER,
32
+ applyDefaultPlugins: () => applyDefaultPlugins,
33
+ getCompiledPath: () => getCompiledPath,
34
+ getRspackVersion: () => getRspackVersion,
35
+ isSatisfyRspackMinimumVersion: () => isSatisfyRspackMinimumVersion,
36
+ supportedRspackMinimumVersion: () => supportedRspackMinimumVersion
37
+ });
38
+ module.exports = __toCommonJS(shared_exports);
39
+ var import_path = require("path");
40
+ var import_shared = require("@rsbuild/shared");
41
+ var import_shared2 = require("@rsbuild/shared");
42
+ var import_shared3 = require("@rsbuild/shared");
43
+ const applyDefaultPlugins = (plugins) => (0, import_shared3.awaitableGetter)([
44
+ Promise.resolve().then(() => __toESM(require("./plugins/transition"))).then((m) => m.pluginTransition()),
45
+ Promise.resolve().then(() => __toESM(require("./plugins/basic"))).then((m) => m.pluginBasic()),
46
+ plugins.entry(),
47
+ // plugins.cache(),
48
+ plugins.target(),
49
+ Promise.resolve().then(() => __toESM(require("./plugins/output"))).then((m) => m.pluginOutput()),
50
+ plugins.devtool(),
51
+ Promise.resolve().then(() => __toESM(require("./plugins/resolve"))).then((m) => m.pluginResolve()),
52
+ plugins.fileSize(),
53
+ // cleanOutput plugin should before the html plugin
54
+ plugins.cleanOutput(),
55
+ plugins.asset(),
56
+ plugins.html(),
57
+ plugins.wasm(),
58
+ plugins.moment(),
59
+ plugins.nodeAddons(),
60
+ plugins.define(),
61
+ Promise.resolve().then(() => __toESM(require("./plugins/css"))).then((m) => m.pluginCss()),
62
+ Promise.resolve().then(() => __toESM(require("./plugins/less"))).then((m) => m.pluginLess()),
63
+ Promise.resolve().then(() => __toESM(require("./plugins/sass"))).then((m) => m.pluginSass()),
64
+ Promise.resolve().then(() => __toESM(require("./plugins/minimize"))).then((m) => m.pluginMinimize()),
65
+ Promise.resolve().then(() => __toESM(require("./plugins/hmr"))).then((m) => m.pluginHMR()),
66
+ Promise.resolve().then(() => __toESM(require("./plugins/progress"))).then((m) => m.pluginProgress()),
67
+ Promise.resolve().then(() => __toESM(require("./plugins/swc"))).then((m) => m.pluginSwc()),
68
+ plugins.externals(),
69
+ plugins.toml(),
70
+ plugins.yaml(),
71
+ plugins.splitChunks(),
72
+ plugins.startUrl(),
73
+ plugins.inlineChunk(),
74
+ plugins.bundleAnalyzer(),
75
+ plugins.networkPerformance(),
76
+ plugins.preloadOrPrefetch(),
77
+ plugins.performance(),
78
+ Promise.resolve().then(() => __toESM(require("./plugins/rspackProfile"))).then((m) => m.pluginRspackProfile())
79
+ ]);
80
+ const getRspackVersion = async () => {
81
+ try {
82
+ const core = require.resolve("@rspack/core");
83
+ const pkg = await Promise.resolve().then(() => __toESM(require((0, import_path.join)(core, "../../package.json"))));
84
+ return pkg == null ? void 0 : pkg.version;
85
+ } catch (err) {
86
+ console.error(err);
87
+ return "";
88
+ }
89
+ };
90
+ const supportedRspackMinimumVersion = "0.3.6";
91
+ const isSatisfyRspackMinimumVersion = async (customVersion) => {
92
+ let version = customVersion || await getRspackVersion();
93
+ const semver = await Promise.resolve().then(() => __toESM(require("semver")));
94
+ if (version.includes("-canary")) {
95
+ version = version.split("-canary")[0];
96
+ }
97
+ return version ? semver.lte(supportedRspackMinimumVersion, version) : true;
98
+ };
99
+ const getCompiledPath = (packageName) => {
100
+ const providerCompilerPath = (0, import_path.join)(__dirname, "../../compiled", packageName);
101
+ if (import_shared2.fse.existsSync(providerCompilerPath)) {
102
+ return providerCompilerPath;
103
+ } else {
104
+ return (0, import_shared.getSharedPkgCompiledPath)(packageName);
105
+ }
106
+ };
107
+ const BUILTIN_LOADER = "builtin:";
108
+ // Annotate the CommonJS export names for ESM import in node:
109
+ 0 && (module.exports = {
110
+ BUILTIN_LOADER,
111
+ applyDefaultPlugins,
112
+ getCompiledPath,
113
+ getRspackVersion,
114
+ isSatisfyRspackMinimumVersion,
115
+ supportedRspackMinimumVersion
116
+ });
@@ -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:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "0.0.25",
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",
@@ -62,12 +62,10 @@
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.25"
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>;