@rsbuild/core 0.0.12 → 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.
- package/dist/cli/config.d.ts +3 -9
- package/dist/cli/index.js +1 -2
- package/dist/plugins/asset.d.ts +2 -1
- package/dist/plugins/asset.js +10 -1
- package/dist/plugins/entry.d.ts +1 -1
- package/dist/plugins/entry.js +2 -12
- package/dist/plugins/html.d.ts +4 -4
- package/dist/plugins/html.js +18 -9
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/startUrl.js +6 -8
- package/dist/rspack-provider/config/defaults.js +1 -4
- package/dist/rspack-provider/core/build.d.ts +4 -5
- package/dist/rspack-provider/core/createCompiler.d.ts +2 -1
- package/dist/rspack-provider/core/createContext.js +0 -4
- package/dist/rspack-provider/core/initConfigs.d.ts +1 -1
- package/dist/rspack-provider/core/initConfigs.js +1 -2
- package/dist/rspack-provider/core/initHooks.d.ts +2 -2
- package/dist/rspack-provider/core/inspectConfig.d.ts +3 -4
- package/dist/rspack-provider/core/rspackConfig.d.ts +2 -2
- package/dist/rspack-provider/core/rspackConfig.js +4 -5
- package/dist/rspack-provider/core/startDevServer.d.ts +3 -4
- package/dist/rspack-provider/core/startDevServer.js +1 -1
- package/dist/rspack-provider/index.d.ts +2 -1
- package/dist/rspack-provider/plugins/css.d.ts +2 -2
- package/dist/rspack-provider/plugins/css.js +2 -2
- package/dist/rspack-provider/plugins/minimize.d.ts +3 -2
- package/dist/rspack-provider/plugins/minimize.js +9 -4
- package/dist/rspack-provider/plugins/swc.d.ts +2 -2
- package/dist/rspack-provider/provider.d.ts +3 -3
- package/dist/rspack-provider/rspackPlugin/removeCssSourcemapPlugin.d.ts +1 -1
- package/dist/rspack-provider/shared/plugin.js +0 -2
- package/dist/rspack-provider/types/context.d.ts +1 -4
- package/dist/rspack-provider/types/hooks.d.ts +2 -10
- package/dist/rspack-provider/types/index.d.ts +1 -2
- package/dist/rspack-provider/types/index.js +1 -5
- package/dist/rspack-provider/types/plugin.d.ts +3 -4
- package/dist/utils/generateMetaTags.d.ts +2 -1
- package/dist/utils/generateMetaTags.js +4 -18
- package/package.json +7 -6
- package/static/openChrome.applescript +95 -0
- package/dist/plugins/checkSyntax.d.ts +0 -0
- package/dist/plugins/checkSyntax.js +0 -1
- package/dist/plugins/svg.d.ts +0 -2
- package/dist/plugins/svg.js +0 -60
- package/dist/rspack-provider/config/validate/dev.d.ts +0 -3
- package/dist/rspack-provider/config/validate/dev.js +0 -29
- package/dist/rspack-provider/config/validate/html.d.ts +0 -3
- package/dist/rspack-provider/config/validate/html.js +0 -29
- package/dist/rspack-provider/config/validate/index.d.ts +0 -4
- package/dist/rspack-provider/config/validate/index.js +0 -50
- package/dist/rspack-provider/config/validate/output.d.ts +0 -3
- package/dist/rspack-provider/config/validate/output.js +0 -29
- package/dist/rspack-provider/config/validate/performance.d.ts +0 -3
- package/dist/rspack-provider/config/validate/performance.js +0 -41
- package/dist/rspack-provider/config/validate/security.d.ts +0 -3
- package/dist/rspack-provider/config/validate/security.js +0 -29
- package/dist/rspack-provider/config/validate/source.d.ts +0 -3
- package/dist/rspack-provider/config/validate/source.js +0 -31
- package/dist/rspack-provider/config/validate/tools.d.ts +0 -3
- package/dist/rspack-provider/config/validate/tools.js +0 -35
- package/dist/rspack-provider/plugins/pug.d.ts +0 -2
- package/dist/rspack-provider/plugins/pug.js +0 -67
- package/dist/rspack-provider/types/config/dev.d.ts +0 -3
- package/dist/rspack-provider/types/config/dev.js +0 -16
- package/dist/rspack-provider/types/config/html.d.ts +0 -3
- package/dist/rspack-provider/types/config/html.js +0 -16
- package/dist/rspack-provider/types/config/index.d.ts +0 -34
- package/dist/rspack-provider/types/config/index.js +0 -34
- package/dist/rspack-provider/types/config/output.d.ts +0 -9
- package/dist/rspack-provider/types/config/output.js +0 -16
- package/dist/rspack-provider/types/config/performance.d.ts +0 -3
- package/dist/rspack-provider/types/config/performance.js +0 -16
- package/dist/rspack-provider/types/config/security.d.ts +0 -3
- package/dist/rspack-provider/types/config/security.js +0 -16
- package/dist/rspack-provider/types/config/source.d.ts +0 -11
- package/dist/rspack-provider/types/config/source.js +0 -16
- package/dist/rspack-provider/types/config/tools.d.ts +0 -21
- package/dist/rspack-provider/types/config/tools.js +0 -16
- package/dist/rspack-provider/types/rspack.d.ts +0 -107
- package/dist/rspack-provider/types/rspack.js +0 -16
|
@@ -1,67 +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 pug_exports = {};
|
|
20
|
-
__export(pug_exports, {
|
|
21
|
-
pluginPug: () => pluginPug
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(pug_exports);
|
|
24
|
-
var import_shared = require("@rsbuild/shared");
|
|
25
|
-
var import_shared2 = require("../shared");
|
|
26
|
-
const getPugTemplateCompiler = (userOptions) => ({
|
|
27
|
-
async compile(content, compileOptions) {
|
|
28
|
-
const options = {
|
|
29
|
-
filename: compileOptions.filename,
|
|
30
|
-
doctype: "html",
|
|
31
|
-
compileDebug: false,
|
|
32
|
-
...userOptions
|
|
33
|
-
};
|
|
34
|
-
const pug = require((0, import_shared2.getCompiledPath)("pug"));
|
|
35
|
-
return `${pug.compileClient(content, options)};
|
|
36
|
-
template;`;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const pluginPug = () => ({
|
|
40
|
-
name: "plugin-pug",
|
|
41
|
-
setup(api) {
|
|
42
|
-
api.modifyBundlerChain(async (chain, { CHAIN_ID }) => {
|
|
43
|
-
const config = api.getNormalizedConfig();
|
|
44
|
-
const { pug } = config.tools;
|
|
45
|
-
if (!pug) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const entries = chain.entryPoints.entries() || {};
|
|
49
|
-
const entryNames = Object.keys(entries);
|
|
50
|
-
const pugOptions = (0, import_shared.mergeChainedOptions)({}, pug === true ? {} : pug);
|
|
51
|
-
const templateCompiler = getPugTemplateCompiler(pugOptions);
|
|
52
|
-
entryNames.forEach((entry) => {
|
|
53
|
-
chain.plugin(`${CHAIN_ID.PLUGIN.HTML}-${entry}`).tap((options) => {
|
|
54
|
-
var _a;
|
|
55
|
-
if ((_a = options[0]) == null ? void 0 : _a.template.endsWith(".pug")) {
|
|
56
|
-
options[0].templateCompiler = templateCompiler;
|
|
57
|
-
}
|
|
58
|
-
return options;
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
-
0 && (module.exports = {
|
|
66
|
-
pluginPug
|
|
67
|
-
});
|
|
@@ -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 dev_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(dev_exports);
|
|
@@ -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 html_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(html_exports);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { DeepReadonly } from '@rsbuild/shared';
|
|
2
|
-
import type { DevConfig, NormalizedDevConfig } from './dev';
|
|
3
|
-
import type { HtmlConfig, NormalizedHtmlConfig } from './html';
|
|
4
|
-
import type { NormalizedOutputConfig, OutputConfig } from './output';
|
|
5
|
-
import type { NormalizedPerformanceConfig, PerformanceConfig } from './performance';
|
|
6
|
-
import type { NormalizedSecurityConfig, SecurityConfig } from './security';
|
|
7
|
-
import type { NormalizedSourceConfig, SourceConfig } from './source';
|
|
8
|
-
import type { NormalizedToolsConfig, ToolsConfig } from './tools';
|
|
9
|
-
/** The Rsbuild config when using rspack-provider */
|
|
10
|
-
export interface RsbuildConfig {
|
|
11
|
-
dev?: DevConfig;
|
|
12
|
-
html?: HtmlConfig;
|
|
13
|
-
tools?: ToolsConfig;
|
|
14
|
-
source?: SourceConfig;
|
|
15
|
-
output?: OutputConfig;
|
|
16
|
-
security?: SecurityConfig;
|
|
17
|
-
performance?: PerformanceConfig;
|
|
18
|
-
}
|
|
19
|
-
export type NormalizedConfig = DeepReadonly<{
|
|
20
|
-
dev: NormalizedDevConfig;
|
|
21
|
-
html: NormalizedHtmlConfig;
|
|
22
|
-
tools: NormalizedToolsConfig;
|
|
23
|
-
source: NormalizedSourceConfig;
|
|
24
|
-
output: NormalizedOutputConfig;
|
|
25
|
-
security: NormalizedSecurityConfig;
|
|
26
|
-
performance: NormalizedPerformanceConfig;
|
|
27
|
-
}>;
|
|
28
|
-
export * from './dev';
|
|
29
|
-
export * from './html';
|
|
30
|
-
export * from './output';
|
|
31
|
-
export * from './performance';
|
|
32
|
-
export * from './security';
|
|
33
|
-
export * from './source';
|
|
34
|
-
export * from './tools';
|
|
@@ -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 __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 config_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(config_exports);
|
|
18
|
-
__reExport(config_exports, require("./dev"), module.exports);
|
|
19
|
-
__reExport(config_exports, require("./html"), module.exports);
|
|
20
|
-
__reExport(config_exports, require("./output"), module.exports);
|
|
21
|
-
__reExport(config_exports, require("./performance"), module.exports);
|
|
22
|
-
__reExport(config_exports, require("./security"), module.exports);
|
|
23
|
-
__reExport(config_exports, require("./source"), module.exports);
|
|
24
|
-
__reExport(config_exports, require("./tools"), module.exports);
|
|
25
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
-
0 && (module.exports = {
|
|
27
|
-
...require("./dev"),
|
|
28
|
-
...require("./html"),
|
|
29
|
-
...require("./output"),
|
|
30
|
-
...require("./performance"),
|
|
31
|
-
...require("./security"),
|
|
32
|
-
...require("./source"),
|
|
33
|
-
...require("./tools")
|
|
34
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { SharedOutputConfig, NormalizedSharedOutputConfig } from '@rsbuild/shared';
|
|
2
|
-
import type { Builtins } from '@rspack/core';
|
|
3
|
-
export type OutputConfig = SharedOutputConfig & {
|
|
4
|
-
/**
|
|
5
|
-
* Copies the specified file or directory to the dist directory.
|
|
6
|
-
*/
|
|
7
|
-
copy?: Builtins['copy'] | NonNullable<Builtins['copy']>['patterns'];
|
|
8
|
-
};
|
|
9
|
-
export type NormalizedOutputConfig = OutputConfig & NormalizedSharedOutputConfig;
|
|
@@ -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 output_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(output_exports);
|
|
@@ -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 performance_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(performance_exports);
|
|
@@ -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 security_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(security_exports);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SharedSourceConfig, NormalizedSharedSourceConfig } from '@rsbuild/shared';
|
|
2
|
-
import type { Builtins } from '@rspack/core';
|
|
3
|
-
import type { RspackBuiltinsConfig } from '../rspack';
|
|
4
|
-
export type SourceConfig = SharedSourceConfig & {
|
|
5
|
-
define?: RspackBuiltinsConfig['define'];
|
|
6
|
-
transformImport?: false | Builtins['pluginImport'];
|
|
7
|
-
};
|
|
8
|
-
export type NormalizedSourceConfig = NormalizedSharedSourceConfig & {
|
|
9
|
-
define: Record<string, string>;
|
|
10
|
-
transformImport?: false | Builtins['pluginImport'];
|
|
11
|
-
};
|
|
@@ -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 source_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(source_exports);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ChainedConfig, SharedToolsConfig, ToolsLessConfig, ToolsSassConfig, PostCSSLoaderOptions, PostCSSPlugin } from '@rsbuild/shared';
|
|
2
|
-
import type { Options as HTMLPluginOptions } from '@rspack/plugin-html';
|
|
3
|
-
import type { RspackConfig } from '../rspack';
|
|
4
|
-
import type { ModifyRspackConfigUtils } from '../hooks';
|
|
5
|
-
export type ToolsPostCSSLoaderConfig = ChainedConfig<PostCSSLoaderOptions, {
|
|
6
|
-
addPlugins: (plugins: PostCSSPlugin | PostCSSPlugin[]) => void;
|
|
7
|
-
}>;
|
|
8
|
-
type ToolsHtmlPluginConfig = ChainedConfig<HTMLPluginOptions, {
|
|
9
|
-
entryName: string;
|
|
10
|
-
entryValue: string | string[];
|
|
11
|
-
}>;
|
|
12
|
-
export type ToolsRspackConfig = ChainedConfig<RspackConfig, ModifyRspackConfigUtils>;
|
|
13
|
-
export interface ToolsConfig extends SharedToolsConfig {
|
|
14
|
-
htmlPlugin?: false | ToolsHtmlPluginConfig;
|
|
15
|
-
postcss?: ToolsPostCSSLoaderConfig;
|
|
16
|
-
rspack?: ToolsRspackConfig;
|
|
17
|
-
less?: ToolsLessConfig;
|
|
18
|
-
sass?: ToolsSassConfig;
|
|
19
|
-
}
|
|
20
|
-
export type NormalizedToolsConfig = ToolsConfig;
|
|
21
|
-
export {};
|
|
@@ -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 tools_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(tools_exports);
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type * as Rspack from '@rspack/core';
|
|
2
|
-
type Compiler = Rspack.Compiler;
|
|
3
|
-
type RspackOptions = Rspack.RspackOptions;
|
|
4
|
-
type MultiCompiler = Rspack.MultiCompiler;
|
|
5
|
-
export type { Compiler, MultiCompiler, Rspack };
|
|
6
|
-
type BuiltinsOptions = NonNullable<RspackOptions['builtins']>;
|
|
7
|
-
export type RspackBuiltinsConfig = Omit<BuiltinsOptions, 'html' | 'react' | 'pluginImport' | 'decorator' | 'presetEnv' | 'emotion' | 'relay'>;
|
|
8
|
-
export declare type JscTarget = 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022';
|
|
9
|
-
export declare type ParserConfig = TsParserConfig | EsParserConfig;
|
|
10
|
-
export interface TsParserConfig {
|
|
11
|
-
syntax: 'typescript';
|
|
12
|
-
tsx?: boolean;
|
|
13
|
-
decorators?: boolean;
|
|
14
|
-
dynamicImport?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface EsParserConfig {
|
|
17
|
-
syntax: 'ecmascript';
|
|
18
|
-
jsx?: boolean;
|
|
19
|
-
functionBind?: boolean;
|
|
20
|
-
decorators?: boolean;
|
|
21
|
-
decoratorsBeforeExport?: boolean;
|
|
22
|
-
exportDefaultFrom?: boolean;
|
|
23
|
-
importAssertions?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export interface ReactConfig {
|
|
26
|
-
pragma?: string;
|
|
27
|
-
pragmaFrag?: string;
|
|
28
|
-
throwIfNamespace?: boolean;
|
|
29
|
-
development?: boolean;
|
|
30
|
-
useBuiltins?: boolean;
|
|
31
|
-
refresh?: boolean;
|
|
32
|
-
runtime?: 'automatic' | 'classic';
|
|
33
|
-
importSource?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface TransformConfig {
|
|
36
|
-
react?: ReactConfig;
|
|
37
|
-
legacyDecorator?: boolean;
|
|
38
|
-
decoratorMetadata?: boolean;
|
|
39
|
-
treatConstEnumAsEnum?: boolean;
|
|
40
|
-
useDefineForClassFields?: boolean;
|
|
41
|
-
}
|
|
42
|
-
export type BuiltinSwcLoaderOptions = {
|
|
43
|
-
env?: {
|
|
44
|
-
mode?: 'usage' | 'entry';
|
|
45
|
-
debug?: boolean;
|
|
46
|
-
loose?: boolean;
|
|
47
|
-
skip?: string[];
|
|
48
|
-
include?: string[];
|
|
49
|
-
exclude?: string[];
|
|
50
|
-
coreJs?: string;
|
|
51
|
-
shippedProposals?: boolean;
|
|
52
|
-
targets?: any;
|
|
53
|
-
};
|
|
54
|
-
isModule?: boolean | 'unknown';
|
|
55
|
-
minify?: boolean;
|
|
56
|
-
sourceMaps?: boolean;
|
|
57
|
-
exclude?: string[];
|
|
58
|
-
inlineSourcesContent?: boolean;
|
|
59
|
-
jsc?: {
|
|
60
|
-
loose?: boolean;
|
|
61
|
-
parser?: ParserConfig;
|
|
62
|
-
transform?: TransformConfig;
|
|
63
|
-
externalHelpers?: boolean;
|
|
64
|
-
target?: JscTarget;
|
|
65
|
-
keepClassNames?: boolean;
|
|
66
|
-
baseUrl?: string;
|
|
67
|
-
paths?: {
|
|
68
|
-
[from: string]: [string];
|
|
69
|
-
};
|
|
70
|
-
preserveAllComments?: boolean;
|
|
71
|
-
};
|
|
72
|
-
rspackExperiments?: Pick<BuiltinsOptions, 'react' | 'decorator' | 'presetEnv' | 'emotion' | 'relay'> & {
|
|
73
|
-
import?: BuiltinsOptions['pluginImport'];
|
|
74
|
-
styledComponents?: {
|
|
75
|
-
displayName?: boolean;
|
|
76
|
-
ssr?: boolean;
|
|
77
|
-
fileName?: boolean;
|
|
78
|
-
meaninglessFileNames?: string[];
|
|
79
|
-
namespace?: string;
|
|
80
|
-
topLevelImportPaths?: string[];
|
|
81
|
-
transpileTemplateLiterals?: boolean;
|
|
82
|
-
minify?: boolean;
|
|
83
|
-
pure?: boolean;
|
|
84
|
-
cssProps?: boolean;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
export interface RspackConfig extends RspackOptions {
|
|
89
|
-
/** multi type is useless in Rsbuild and make get value difficult */
|
|
90
|
-
entry?: Record<string, string | string[]>;
|
|
91
|
-
/**
|
|
92
|
-
* `builtins.react / pluginImport / decorator / presetEnv / emotion / relay` are no longer supported by Rspack,
|
|
93
|
-
* please migrate to [builtin:swc-loader options](https://rsbuild.dev/guide/advanced/rspack-start.html#5-swc-configuration-support)
|
|
94
|
-
*
|
|
95
|
-
* `builtins.html` are no longer supported by Rspack, please use [tools.htmlPlugin](https://rsbuild.dev/api/config-tools.html#toolshtmlplugin) instead.
|
|
96
|
-
*/
|
|
97
|
-
builtins?: Omit<BuiltinsOptions, 'html'>;
|
|
98
|
-
/** rspack-dev-server is not used in modern.js */
|
|
99
|
-
devServer?: {
|
|
100
|
-
hot?: boolean;
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
/** T[] => T */
|
|
104
|
-
type GetElementType<T extends any[]> = T extends (infer U)[] ? U : never;
|
|
105
|
-
export type RspackRule = GetElementType<NonNullable<NonNullable<RspackConfig['module']>['rules']>>;
|
|
106
|
-
export type RuleSetRule = Rspack.RuleSetRule;
|
|
107
|
-
export type RspackPluginInstance = GetElementType<NonNullable<RspackConfig['plugins']>>;
|
|
@@ -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 rspack_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(rspack_exports);
|