@rsbuild/webpack 0.0.9 → 0.0.13

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 (60) hide show
  1. package/compiled/webpack-manifest-plugin/types/helpers.d.ts +1 -1
  2. package/compiled/webpack-manifest-plugin/types/hooks.d.ts +1 -1
  3. package/dist/config/defaults.js +1 -4
  4. package/dist/core/createContext.js +0 -4
  5. package/dist/core/devMiddleware.js +6 -6
  6. package/dist/core/initConfigs.d.ts +2 -2
  7. package/dist/core/initConfigs.js +1 -2
  8. package/dist/core/webpackConfig.js +7 -8
  9. package/dist/plugins/babel.js +5 -11
  10. package/dist/plugins/minimize.js +5 -2
  11. package/dist/plugins/moduleScopes.d.ts +2 -2
  12. package/dist/plugins/react.d.ts +2 -0
  13. package/dist/plugins/react.js +96 -0
  14. package/dist/plugins/tsLoader.js +54 -56
  15. package/dist/shared/plugin.js +1 -2
  16. package/dist/types/config/index.d.ts +6 -14
  17. package/dist/types/config/index.js +0 -10
  18. package/dist/types/config/security.d.ts +3 -3
  19. package/dist/types/config/source.d.ts +4 -13
  20. package/dist/types/config/tools.d.ts +15 -18
  21. package/dist/types/context.d.ts +0 -2
  22. package/dist/types/hooks.d.ts +7 -2
  23. package/dist/types/thirdParty/index.d.ts +0 -2
  24. package/package.json +32 -29
  25. package/dist/config/validate/dev.d.ts +0 -3
  26. package/dist/config/validate/dev.js +0 -29
  27. package/dist/config/validate/experiments.d.ts +0 -3
  28. package/dist/config/validate/experiments.js +0 -29
  29. package/dist/config/validate/html.d.ts +0 -3
  30. package/dist/config/validate/html.js +0 -29
  31. package/dist/config/validate/index.d.ts +0 -4
  32. package/dist/config/validate/index.js +0 -52
  33. package/dist/config/validate/output.d.ts +0 -3
  34. package/dist/config/validate/output.js +0 -37
  35. package/dist/config/validate/performance.d.ts +0 -3
  36. package/dist/config/validate/performance.js +0 -47
  37. package/dist/config/validate/security.d.ts +0 -4
  38. package/dist/config/validate/security.js +0 -38
  39. package/dist/config/validate/source.d.ts +0 -3
  40. package/dist/config/validate/source.js +0 -34
  41. package/dist/config/validate/tools.d.ts +0 -3
  42. package/dist/config/validate/tools.js +0 -57
  43. package/dist/exports/HtmlWebpackPlugin.d.ts +0 -2
  44. package/dist/exports/HtmlWebpackPlugin.js +0 -35
  45. package/dist/plugins/pug.d.ts +0 -2
  46. package/dist/plugins/pug.js +0 -52
  47. package/dist/types/config/dev.d.ts +0 -3
  48. package/dist/types/config/dev.js +0 -16
  49. package/dist/types/config/experiments.d.ts +0 -3
  50. package/dist/types/config/experiments.js +0 -16
  51. package/dist/types/config/html.d.ts +0 -3
  52. package/dist/types/config/html.js +0 -16
  53. package/dist/types/config/output.d.ts +0 -9
  54. package/dist/types/config/output.js +0 -16
  55. package/dist/types/config/performance.d.ts +0 -3
  56. package/dist/types/config/performance.js +0 -16
  57. package/dist/types/thirdParty/CopyWebpackPlugin.d.ts +0 -62
  58. package/dist/types/thirdParty/CopyWebpackPlugin.js +0 -16
  59. package/dist/webpackLoaders/pugLoader.d.ts +0 -3
  60. package/dist/webpackLoaders/pugLoader.js +0 -44
@@ -1,6 +1,8 @@
1
- import type { ArrayOrNot, ChainedConfig, FileFilterUtil, SharedToolsConfig, ToolsLessConfig, ToolsSassConfig, TerserPluginOptions } from '@rsbuild/shared';
1
+ import type { ArrayOrNot, ChainedConfig, FileFilterUtil, TerserPluginOptions, ToolsConfig as BaseToolsConfig } from '@rsbuild/shared';
2
+ import type { BabelTransformOptions, BabelConfigUtils } from '@rsbuild/plugin-babel';
3
+ import type { PluginCssMinimizerOptions } from '@rsbuild/plugin-css-minimizer';
2
4
  import type { ModifyWebpackChainUtils, ModifyWebpackConfigUtils } from '../hooks';
3
- import type { CSSExtractOptions, HTMLPluginOptions, TSLoaderOptions, WebpackChain, WebpackConfig } from '../thirdParty';
5
+ import type { WebpackChain, WebpackConfig, TSLoaderOptions, CSSExtractOptions } from '../thirdParty';
4
6
  import type { NormalizedCSSExtractOptions } from '../thirdParty/css';
5
7
  export type ToolsTerserConfig = ChainedConfig<TerserPluginOptions>;
6
8
  export type ToolsTSLoaderConfig = ChainedConfig<TSLoaderOptions, {
@@ -8,22 +10,17 @@ export type ToolsTSLoaderConfig = ChainedConfig<TSLoaderOptions, {
8
10
  addExcludes: FileFilterUtil;
9
11
  }>;
10
12
  export type ToolsCssExtractConfig = CSSExtractOptions | ((options: CSSExtractOptions) => CSSExtractOptions | void);
11
- export type ToolsHtmlPluginConfig = ChainedConfig<HTMLPluginOptions, {
12
- entryName: string;
13
- entryValue: WebpackConfig['entry'];
14
- }>;
15
13
  export type ToolsWebpackConfig = ChainedConfig<WebpackConfig, ModifyWebpackConfigUtils>;
16
14
  export type ToolsWebpackChainConfig = ArrayOrNot<(chain: WebpackChain, utils: ModifyWebpackChainUtils) => void>;
17
- export interface ToolsConfig extends SharedToolsConfig {
18
- /**
19
- /**
20
- * Modify the config of [sass-loader](https://github.com/webpack-contrib/sass-loader).
21
- */
22
- sass?: ToolsSassConfig;
15
+ export type ToolsBabelConfig = ChainedConfig<BabelTransformOptions, BabelConfigUtils>;
16
+ export interface ToolsConfig extends BaseToolsConfig {
23
17
  /**
24
- * Modify the config of [less-loader](https://github.com/webpack-contrib/less-loader).
18
+ * Modify the options of [babel-loader](https://github.com/babel/babel-loader)
19
+ * When `tools.babel`'s type is Function,the default babel config will be passed in as the first parameter, the config object can be modified directly, or a value can be returned as the final result.
20
+ * When `tools.babel`'s type is `Object`, the config will be shallow merged with default config by `Object.assign`.
21
+ * Note that `Object.assign` is a shallow copy and will completely overwrite the built-in `presets` or `plugins` array, please use it with caution.
25
22
  */
26
- less?: ToolsLessConfig;
23
+ babel?: ToolsBabelConfig;
27
24
  /**
28
25
  * Modify the options of [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin).
29
26
  */
@@ -33,10 +30,6 @@ export interface ToolsConfig extends SharedToolsConfig {
33
30
  * When `tools.tsLoader` is not undefined, Rsbuild will use ts-loader instead of babel-loader to compile TypeScript code.
34
31
  */
35
32
  tsLoader?: ToolsTSLoaderConfig;
36
- /**
37
- * Modify the options of [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin).
38
- */
39
- htmlPlugin?: false | ToolsHtmlPluginConfig;
40
33
  /**
41
34
  * Modify the options of [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin).
42
35
  */
@@ -49,6 +42,10 @@ export interface ToolsConfig extends SharedToolsConfig {
49
42
  * Configure webpack by [webpack-chain](https://github.com/neutrinojs/webpack-chain).
50
43
  */
51
44
  webpackChain?: ToolsWebpackChainConfig;
45
+ /**
46
+ * Modify the options of [css-minimizer-webpack-plugin](https://github.com/webpack-contrib/css-minimizer-webpack-plugin).
47
+ */
48
+ minifyCss?: PluginCssMinimizerOptions['pluginOptions'];
52
49
  }
53
50
  export interface NormalizedToolsConfig extends ToolsConfig {
54
51
  cssExtract: NormalizedCSSExtractOptions;
@@ -8,8 +8,6 @@ export type Context = BaseContext & {
8
8
  hooks: Readonly<Hooks>;
9
9
  /** Current Rsbuild config. */
10
10
  config: Readonly<RsbuildConfig>;
11
- /** The async task to validate schema of config. */
12
- configValidatingTask: Promise<void>;
13
11
  /** The original Rsbuild config passed from the createRsbuild method. */
14
12
  originalConfig: Readonly<RsbuildConfig>;
15
13
  /** The normalized Rsbuild config. */
@@ -2,10 +2,15 @@ import type { ChainIdentifier, ModifyChainUtils } from '@rsbuild/shared';
2
2
  import type { WebpackChain, WebpackConfig } from './thirdParty';
3
3
  import type { RuleSetRule, WebpackPluginInstance } from 'webpack';
4
4
  export type ModifyWebpackChainUtils = ModifyChainUtils & {
5
- /** @deprecated Use target instead. */
6
- name: string;
7
5
  webpack: typeof import('webpack');
8
6
  CHAIN_ID: ChainIdentifier;
7
+ /**
8
+ * @deprecated Use target instead.
9
+ * */
10
+ name: string;
11
+ /**
12
+ * @deprecated Use HtmlPlugin instead.
13
+ */
9
14
  HtmlWebpackPlugin: typeof import('html-webpack-plugin');
10
15
  };
11
16
  export type ModifyWebpackConfigUtils = ModifyWebpackChainUtils & {
@@ -2,8 +2,6 @@ import type { WebpackChain } from '@rsbuild/shared';
2
2
  import type webpack from 'webpack';
3
3
  import type { Configuration as WebpackConfig } from 'webpack';
4
4
  import type { Options as RawTSLoaderOptions } from 'ts-loader';
5
- export type { BabelTransformOptions, BabelConfigUtils } from '@rsbuild/shared';
6
- export type { CopyPluginOptions } from './CopyWebpackPlugin';
7
5
  export type { Options as HTMLPluginOptions } from 'html-webpack-plugin';
8
6
  export type { SubresourceIntegrityPluginOptions as SubresourceIntegrityOptions } from 'webpack-subresource-integrity';
9
7
  export type TSLoaderOptions = Partial<RawTSLoaderOptions>;
package/package.json CHANGED
@@ -1,21 +1,13 @@
1
1
  {
2
2
  "name": "@rsbuild/webpack",
3
+ "version": "0.0.13",
3
4
  "homepage": "https://rsbuild.dev",
4
5
  "repository": {
5
6
  "type": "git",
6
7
  "url": "https://github.com/web-infra-dev/rsbuild",
7
- "directory": "packages/webpack"
8
- },
9
- "bugs": {
10
- "url": "https://github.com/web-infra-dev/rsbuild/issues"
11
- },
12
- "engines": {
13
- "node": ">=14.0.0"
8
+ "directory": "packages/compat/webpack"
14
9
  },
15
10
  "license": "MIT",
16
- "version": "0.0.9",
17
- "types": "./dist/index.d.ts",
18
- "main": "./dist/index.js",
19
11
  "exports": {
20
12
  ".": {
21
13
  "types": "./dist/index.d.ts",
@@ -30,6 +22,8 @@
30
22
  "default": "./dist/plugins/babel.js"
31
23
  }
32
24
  },
25
+ "main": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
33
27
  "typesVersions": {
34
28
  "*": {
35
29
  "plugin-babel": [
@@ -45,41 +39,50 @@
45
39
  "compiled",
46
40
  "dist"
47
41
  ],
48
- "publishConfig": {
49
- "registry": "https://registry.npmjs.org/",
50
- "access": "public",
51
- "provenance": true
52
- },
53
42
  "dependencies": {
54
- "@modern-js/server": "^2.38.0",
43
+ "@babel/core": "^7.23.2",
44
+ "@babel/preset-react": "^7.22.15",
45
+ "@modern-js/server": "^2.39.2",
55
46
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
47
+ "babel-loader": "9.1.3",
56
48
  "babel-plugin-import": "1.13.5",
57
- "caniuse-lite": "^1.0.30001520",
49
+ "babel-plugin-transform-react-remove-prop-types": "0.4.24",
50
+ "caniuse-lite": "^1.0.30001559",
58
51
  "html-webpack-plugin": "5.5.3",
59
52
  "lodash": "^4.17.21",
60
53
  "mini-css-extract-plugin": "2.7.6",
61
54
  "postcss": "8.4.31",
62
- "react-refresh": "0.14.0",
55
+ "react-refresh": "^0.14.0",
63
56
  "style-loader": "3.3.3",
64
57
  "terser-webpack-plugin": "5.3.9",
65
- "tsconfig-paths-webpack-plugin": "4.1.0",
66
58
  "ts-loader": "9.4.4",
67
- "webpack": "^5.88.1",
59
+ "tsconfig-paths-webpack-plugin": "4.1.0",
60
+ "webpack": "^5.89.0",
68
61
  "webpack-subresource-integrity": "5.1.0",
69
- "@rsbuild/core": "0.0.9",
70
- "@rsbuild/babel-preset": "0.0.9",
71
- "@rsbuild/shared": "0.0.9"
62
+ "@rsbuild/babel-preset": "0.0.13",
63
+ "@rsbuild/core": "0.0.13",
64
+ "@rsbuild/plugin-babel": "0.0.13",
65
+ "@rsbuild/plugin-css-minimizer": "0.0.13",
66
+ "@rsbuild/shared": "0.0.13"
72
67
  },
73
68
  "devDependencies": {
74
69
  "@types/lodash": "^4.14.200",
75
70
  "@types/node": "^16",
76
- "typescript": "^5",
77
- "react": "^18",
78
- "react-dom": "^18",
79
- "@rsbuild/test-helper": "0.0.9"
71
+ "react": "^18.2.0",
72
+ "react-dom": "^18.2.0",
73
+ "typescript": "^5.2.2",
74
+ "@rsbuild/test-helper": "0.0.13"
75
+ },
76
+ "engines": {
77
+ "node": ">=14.0.0"
78
+ },
79
+ "publishConfig": {
80
+ "access": "public",
81
+ "provenance": true,
82
+ "registry": "https://registry.npmjs.org/"
80
83
  },
81
84
  "scripts": {
82
- "dev": "modern build --watch",
83
- "build": "modern build"
85
+ "build": "modern build",
86
+ "dev": "modern build --watch"
84
87
  }
85
88
  }
@@ -1,3 +0,0 @@
1
- import { z } from '@rsbuild/shared';
2
- import type { DevConfig } from '../../types';
3
- export declare const devConfigSchema: z.ZodType<DevConfig>;
@@ -1,29 +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 dev_exports = {};
20
- __export(dev_exports, {
21
- devConfigSchema: () => devConfigSchema
22
- });
23
- module.exports = __toCommonJS(dev_exports);
24
- var import_shared = require("@rsbuild/shared");
25
- const devConfigSchema = import_shared.sharedDevConfigSchema;
26
- // Annotate the CommonJS export names for ESM import in node:
27
- 0 && (module.exports = {
28
- devConfigSchema
29
- });
@@ -1,3 +0,0 @@
1
- import { z } from '@rsbuild/shared';
2
- import type { ExperimentsConfig } from '../../types';
3
- export declare const experimentsConfigSchema: z.ZodType<ExperimentsConfig>;
@@ -1,29 +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 experiments_exports = {};
20
- __export(experiments_exports, {
21
- experimentsConfigSchema: () => experimentsConfigSchema
22
- });
23
- module.exports = __toCommonJS(experiments_exports);
24
- var import_shared = require("@rsbuild/shared");
25
- const experimentsConfigSchema = import_shared.sharedExperimentsConfigSchema;
26
- // Annotate the CommonJS export names for ESM import in node:
27
- 0 && (module.exports = {
28
- experimentsConfigSchema
29
- });
@@ -1,3 +0,0 @@
1
- import { z } from '@rsbuild/shared';
2
- import type { HtmlConfig } from '../../types';
3
- export declare const htmlConfigSchema: z.ZodType<HtmlConfig>;
@@ -1,29 +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 html_exports = {};
20
- __export(html_exports, {
21
- htmlConfigSchema: () => htmlConfigSchema
22
- });
23
- module.exports = __toCommonJS(html_exports);
24
- var import_shared = require("@rsbuild/shared");
25
- const htmlConfigSchema = import_shared.sharedHtmlConfigSchema;
26
- // Annotate the CommonJS export names for ESM import in node:
27
- 0 && (module.exports = {
28
- htmlConfigSchema
29
- });
@@ -1,4 +0,0 @@
1
- import { z } from '@rsbuild/shared/zod';
2
- import { RsbuildConfig } from '../../types';
3
- export declare const configSchema: z.ZodType<RsbuildConfig>;
4
- export declare const validateRsbuildConfig: (data: unknown) => Promise<unknown>;
@@ -1,52 +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 validate_exports = {};
20
- __export(validate_exports, {
21
- configSchema: () => configSchema,
22
- validateRsbuildConfig: () => validateRsbuildConfig
23
- });
24
- module.exports = __toCommonJS(validate_exports);
25
- var import_zod = require("@rsbuild/shared/zod");
26
- var import_shared = require("@rsbuild/shared");
27
- var import_dev = require("./dev");
28
- var import_experiments = require("./experiments");
29
- var import_html = require("./html");
30
- var import_output = require("./output");
31
- var import_performance = require("./performance");
32
- var import_security = require("./security");
33
- var import_source = require("./source");
34
- var import_tools = require("./tools");
35
- const configSchema = import_zod.z.partialObj({
36
- source: import_source.sourceConfigSchema,
37
- dev: import_dev.devConfigSchema,
38
- html: import_html.htmlConfigSchema,
39
- experiments: import_experiments.experimentsConfigSchema,
40
- output: import_output.outputConfigSchema,
41
- performance: import_performance.performanceConfigSchema,
42
- security: import_security.securityConfigSchema,
43
- tools: import_tools.toolsConfigSchema
44
- });
45
- const validateRsbuildConfig = async (data) => {
46
- return (0, import_shared.validateRsbuildConfig)(configSchema, data);
47
- };
48
- // Annotate the CommonJS export names for ESM import in node:
49
- 0 && (module.exports = {
50
- configSchema,
51
- validateRsbuildConfig
52
- });
@@ -1,3 +0,0 @@
1
- import { z } from '@rsbuild/shared';
2
- import type { OutputConfig } from '../../types';
3
- export declare const outputConfigSchema: z.ZodType<OutputConfig>;
@@ -1,37 +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 output_exports = {};
20
- __export(output_exports, {
21
- outputConfigSchema: () => outputConfigSchema
22
- });
23
- module.exports = __toCommonJS(output_exports);
24
- var import_shared = require("@rsbuild/shared");
25
- const AdditionalOptionsSchema = import_shared.z.partialObj({ concurrency: import_shared.z.number() });
26
- const CopyPluginPatternsSchema = import_shared.z.array(import_shared.z.any());
27
- const CopyPluginOptionsSchema = import_shared.z.object({
28
- patterns: CopyPluginPatternsSchema,
29
- options: import_shared.z.optional(AdditionalOptionsSchema)
30
- });
31
- const outputConfigSchema = import_shared.sharedOutputConfigSchema.extend({
32
- copy: import_shared.z.union([CopyPluginOptionsSchema, CopyPluginPatternsSchema])
33
- }).partial();
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- outputConfigSchema
37
- });
@@ -1,3 +0,0 @@
1
- import { z } from '@rsbuild/shared';
2
- import type { PerformanceConfig } from '../../types';
3
- export declare const performanceConfigSchema: z.ZodType<PerformanceConfig>;
@@ -1,47 +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 performance_exports = {};
20
- __export(performance_exports, {
21
- performanceConfigSchema: () => performanceConfigSchema
22
- });
23
- module.exports = __toCommonJS(performance_exports);
24
- var import_shared = require("@rsbuild/shared");
25
- const BaseChunkSplitSchema = import_shared.BaseSplitRulesSchema.extend({
26
- strategy: import_shared.z.enum([
27
- "split-by-module",
28
- "split-by-experience",
29
- "all-in-one",
30
- "single-vendor"
31
- ]),
32
- forceSplitting: import_shared.ForceSplittingSchema,
33
- override: import_shared.z.any().optional()
34
- });
35
- const RsbuildChunkSplitSchema = import_shared.z.union([
36
- BaseChunkSplitSchema,
37
- import_shared.SplitBySizeSchema,
38
- import_shared.SplitCustomSchema
39
- ]);
40
- const performanceConfigSchema = import_shared.sharedPerformanceConfigSchema.extend({
41
- bundleAnalyze: import_shared.z.any(),
42
- chunkSplit: RsbuildChunkSplitSchema
43
- }).partial();
44
- // Annotate the CommonJS export names for ESM import in node:
45
- 0 && (module.exports = {
46
- performanceConfigSchema
47
- });
@@ -1,4 +0,0 @@
1
- import { z, SriOptions } from '@rsbuild/shared';
2
- import type { SecurityConfig } from '../../types';
3
- export declare const SriOptionsSchema: z.ZodType<SriOptions>;
4
- export declare const securityConfigSchema: z.ZodType<SecurityConfig>;
@@ -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 security_exports = {};
20
- __export(security_exports, {
21
- SriOptionsSchema: () => SriOptionsSchema,
22
- securityConfigSchema: () => securityConfigSchema
23
- });
24
- module.exports = __toCommonJS(security_exports);
25
- var import_shared = require("@rsbuild/shared");
26
- const SriOptionsSchema = import_shared.z.partialObj({
27
- hashFuncNames: import_shared.z.array(import_shared.z.string()).min(1),
28
- enabled: import_shared.z.literals(["auto", true, false]),
29
- hashLoading: import_shared.z.enum(["eager", "lazy"])
30
- });
31
- const securityConfigSchema = import_shared.sharedSecurityConfigSchema.extend({
32
- sri: import_shared.z.union([SriOptionsSchema, import_shared.z.boolean()])
33
- }).partial();
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- SriOptionsSchema,
37
- securityConfigSchema
38
- });
@@ -1,3 +0,0 @@
1
- import { z } from '@rsbuild/shared';
2
- import type { SourceConfig } from '../../types';
3
- export declare const sourceConfigSchema: z.ZodType<SourceConfig>;
@@ -1,34 +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 source_exports = {};
20
- __export(source_exports, {
21
- sourceConfigSchema: () => sourceConfigSchema
22
- });
23
- module.exports = __toCommonJS(source_exports);
24
- var import_shared = require("@rsbuild/shared");
25
- const sourceConfigSchema = import_shared.sharedSourceConfigSchema.extend({
26
- define: import_shared.z.record(import_shared.z.any()),
27
- moduleScopes: import_shared.z.chained(
28
- import_shared.z.array(import_shared.z.union([import_shared.z.string(), import_shared.z.instanceof(RegExp)]))
29
- )
30
- }).partial();
31
- // Annotate the CommonJS export names for ESM import in node:
32
- 0 && (module.exports = {
33
- sourceConfigSchema
34
- });
@@ -1,3 +0,0 @@
1
- import { z } from '@rsbuild/shared';
2
- import type { ToolsConfig } from '../../types';
3
- export declare const toolsConfigSchema: z.ZodType<ToolsConfig>;
@@ -1,57 +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 tools_exports = {};
20
- __export(tools_exports, {
21
- toolsConfigSchema: () => toolsConfigSchema
22
- });
23
- module.exports = __toCommonJS(tools_exports);
24
- var import_shared = require("@rsbuild/shared");
25
- const toolsConfigSchema = import_shared.sharedToolsConfigSchema.extend({
26
- pug: import_shared.z.union([import_shared.z.literal(true), import_shared.z.chained(import_shared.z.any())]),
27
- sass: import_shared.z.chained(import_shared.z.any(), import_shared.z.object({ addExcludes: import_shared.FileFilterUtilSchema })),
28
- less: import_shared.z.chained(import_shared.z.any(), import_shared.z.object({ addExcludes: import_shared.FileFilterUtilSchema })),
29
- babel: import_shared.z.chained(import_shared.z.any(), import_shared.z.any()),
30
- terser: import_shared.z.chained(import_shared.z.any()),
31
- tsLoader: import_shared.z.chained(
32
- import_shared.z.any(),
33
- import_shared.z.object({
34
- addIncludes: import_shared.z.string(),
35
- addExcludes: import_shared.FileFilterUtilSchema
36
- })
37
- ),
38
- minifyCss: import_shared.z.chained(import_shared.z.any()),
39
- htmlPlugin: import_shared.z.chained(
40
- import_shared.z.any(),
41
- import_shared.z.object({ entryName: import_shared.z.string(), entryValue: import_shared.z.any() })
42
- ),
43
- cssLoader: import_shared.z.chained(import_shared.z.any(), import_shared.z.object({ addPlugins: import_shared.z.function() })),
44
- styleLoader: import_shared.z.chained(import_shared.z.any()),
45
- cssExtract: import_shared.z.partialObj({
46
- pluginOptions: import_shared.z.any(),
47
- loaderOptions: import_shared.z.any()
48
- }),
49
- postcss: import_shared.z.chained(import_shared.z.any(), import_shared.z.object({ addPlugins: import_shared.z.function() })),
50
- autoprefixer: import_shared.z.chained(import_shared.z.any()),
51
- webpack: import_shared.z.chained(import_shared.z.any(), import_shared.z.any()),
52
- webpackChain: import_shared.z.arrayOrNot(import_shared.z.function())
53
- }).partial();
54
- // Annotate the CommonJS export names for ESM import in node:
55
- 0 && (module.exports = {
56
- toolsConfigSchema
57
- });
@@ -1,2 +0,0 @@
1
- import HtmlWebpackPlugin from 'html-webpack-plugin';
2
- export default HtmlWebpackPlugin;
@@ -1,35 +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 HtmlWebpackPlugin_exports = {};
30
- __export(HtmlWebpackPlugin_exports, {
31
- default: () => HtmlWebpackPlugin_default
32
- });
33
- module.exports = __toCommonJS(HtmlWebpackPlugin_exports);
34
- var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"));
35
- var HtmlWebpackPlugin_default = import_html_webpack_plugin.default;