@rsbuild/core 0.0.9 → 0.0.10
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/plugins/html.d.ts +5 -1
- package/dist/plugins/html.js +16 -1
- package/dist/plugins/startUrl.d.ts +9 -0
- package/dist/plugins/startUrl.js +57 -1
- package/dist/rspack-provider/shared/plugin.js +0 -1
- package/dist/utils/generateMetaTags.d.ts +11 -0
- package/dist/utils/generateMetaTags.js +64 -0
- package/package.json +4 -3
- package/dist/rspack-provider/plugins/babel.d.ts +0 -12
- package/dist/rspack-provider/plugins/babel.js +0 -130
package/dist/plugins/html.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import type { DefaultRsbuildPlugin, SharedRsbuildPluginAPI } from '@rsbuild/shared';
|
|
1
|
+
import type { SharedHtmlConfig, DefaultRsbuildPlugin, SharedRsbuildPluginAPI, NormalizedSharedOutputConfig } from '@rsbuild/shared';
|
|
2
|
+
export declare function getMetaTags(entryName: string, config: {
|
|
3
|
+
html: SharedHtmlConfig;
|
|
4
|
+
output: NormalizedSharedOutputConfig;
|
|
5
|
+
}): Promise<string>;
|
|
2
6
|
export declare const applyInjectTags: (api: SharedRsbuildPluginAPI) => void;
|
|
3
7
|
export declare const pluginHtml: () => DefaultRsbuildPlugin;
|
package/dist/plugins/html.js
CHANGED
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var html_exports = {};
|
|
30
30
|
__export(html_exports, {
|
|
31
31
|
applyInjectTags: () => applyInjectTags,
|
|
32
|
+
getMetaTags: () => getMetaTags,
|
|
32
33
|
pluginHtml: () => pluginHtml
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(html_exports);
|
|
@@ -36,9 +37,22 @@ var import_path = __toESM(require("path"));
|
|
|
36
37
|
var import_shared = require("@rsbuild/shared");
|
|
37
38
|
var import_fs_extra = require("@rsbuild/shared/fs-extra");
|
|
38
39
|
var import_lodash = __toESM(require("lodash"));
|
|
40
|
+
var import_generateMetaTags = require("../utils/generateMetaTags");
|
|
41
|
+
async function getMetaTags(entryName, config) {
|
|
42
|
+
var _a;
|
|
43
|
+
const { meta, metaByEntries } = config.html;
|
|
44
|
+
const metaOptions = {
|
|
45
|
+
...meta != null ? meta : {},
|
|
46
|
+
...(_a = metaByEntries == null ? void 0 : metaByEntries[entryName]) != null ? _a : {}
|
|
47
|
+
};
|
|
48
|
+
if (config.output.charset === "utf8") {
|
|
49
|
+
metaOptions.charset = { charset: "utf-8" };
|
|
50
|
+
}
|
|
51
|
+
return (0, import_generateMetaTags.generateMetaTags)(metaOptions);
|
|
52
|
+
}
|
|
39
53
|
async function getTemplateParameters(entryName, config, assetPrefix) {
|
|
40
54
|
const { mountId, templateParameters, templateParametersByEntries } = config.html;
|
|
41
|
-
const meta = await
|
|
55
|
+
const meta = await getMetaTags(entryName, config);
|
|
42
56
|
const title = (0, import_shared.getTitle)(entryName, config);
|
|
43
57
|
const templateParams = (templateParametersByEntries == null ? void 0 : templateParametersByEntries[entryName]) || templateParameters;
|
|
44
58
|
const baseParameters = {
|
|
@@ -214,5 +228,6 @@ const pluginHtml = () => ({
|
|
|
214
228
|
// Annotate the CommonJS export names for ESM import in node:
|
|
215
229
|
0 && (module.exports = {
|
|
216
230
|
applyInjectTags,
|
|
231
|
+
getMetaTags,
|
|
217
232
|
pluginHtml
|
|
218
233
|
});
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { type DefaultRsbuildPlugin } from '@rsbuild/shared';
|
|
2
|
+
/**
|
|
3
|
+
* This method is modified based on source found in
|
|
4
|
+
* https://github.com/facebook/create-react-app
|
|
5
|
+
*
|
|
6
|
+
* MIT Licensed
|
|
7
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
8
|
+
* https://github.com/facebook/create-react-app/blob/master/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
export declare function openBrowser(url: string): Promise<boolean>;
|
|
2
11
|
export declare const replacePlaceholder: (url: string, port: number) => string;
|
|
3
12
|
export declare function pluginStartUrl(): DefaultRsbuildPlugin;
|
package/dist/plugins/startUrl.js
CHANGED
|
@@ -28,12 +28,68 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var startUrl_exports = {};
|
|
30
30
|
__export(startUrl_exports, {
|
|
31
|
+
openBrowser: () => openBrowser,
|
|
31
32
|
pluginStartUrl: () => pluginStartUrl,
|
|
32
33
|
replacePlaceholder: () => replacePlaceholder
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(startUrl_exports);
|
|
35
36
|
var import_lodash = __toESM(require("lodash"));
|
|
37
|
+
var import_path = require("path");
|
|
36
38
|
var import_shared = require("@rsbuild/shared");
|
|
39
|
+
var import_child_process = require("child_process");
|
|
40
|
+
const supportedChromiumBrowsers = [
|
|
41
|
+
"Google Chrome Canary",
|
|
42
|
+
"Google Chrome Dev",
|
|
43
|
+
"Google Chrome Beta",
|
|
44
|
+
"Google Chrome",
|
|
45
|
+
"Microsoft Edge",
|
|
46
|
+
"Brave Browser",
|
|
47
|
+
"Vivaldi",
|
|
48
|
+
"Chromium"
|
|
49
|
+
];
|
|
50
|
+
const getTargetBrowser = () => {
|
|
51
|
+
let targetBrowser = process.env.BROWSER;
|
|
52
|
+
if (!targetBrowser || !supportedChromiumBrowsers.includes(targetBrowser)) {
|
|
53
|
+
const ps = (0, import_child_process.execSync)("ps cax").toString();
|
|
54
|
+
targetBrowser = supportedChromiumBrowsers.find((b) => ps.includes(b));
|
|
55
|
+
}
|
|
56
|
+
return targetBrowser;
|
|
57
|
+
};
|
|
58
|
+
async function openBrowser(url) {
|
|
59
|
+
const shouldTryOpenChromeWithAppleScript = process.platform === "darwin";
|
|
60
|
+
if (shouldTryOpenChromeWithAppleScript) {
|
|
61
|
+
try {
|
|
62
|
+
const targetBrowser = getTargetBrowser();
|
|
63
|
+
if (targetBrowser) {
|
|
64
|
+
(0, import_child_process.execSync)(
|
|
65
|
+
`osascript openChrome.applescript "${encodeURI(
|
|
66
|
+
url
|
|
67
|
+
)}" "${targetBrowser}"`,
|
|
68
|
+
{
|
|
69
|
+
stdio: "ignore",
|
|
70
|
+
cwd: (0, import_path.join)(__dirname, "../../static")
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
} catch (err) {
|
|
77
|
+
import_shared.logger.error(
|
|
78
|
+
"Failed to open start URL with apple script:",
|
|
79
|
+
JSON.stringify(err)
|
|
80
|
+
);
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
const { default: open } = await Promise.resolve().then(() => __toESM(require("open")));
|
|
86
|
+
await open(url);
|
|
87
|
+
return true;
|
|
88
|
+
} catch (err) {
|
|
89
|
+
import_shared.logger.error("Failed to open start URL:", JSON.stringify(err));
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
37
93
|
const replacePlaceholder = (url, port) => url.replace(/<port>/g, String(port));
|
|
38
94
|
const openedURLs = [];
|
|
39
95
|
function pluginStartUrl() {
|
|
@@ -65,7 +121,6 @@ function pluginStartUrl() {
|
|
|
65
121
|
)
|
|
66
122
|
);
|
|
67
123
|
}
|
|
68
|
-
const { openBrowser } = await Promise.resolve().then(() => __toESM(require("@rsbuild/shared")));
|
|
69
124
|
const openUrls = () => {
|
|
70
125
|
for (const url of urls) {
|
|
71
126
|
if (!openedURLs.includes(url)) {
|
|
@@ -87,6 +142,7 @@ function pluginStartUrl() {
|
|
|
87
142
|
}
|
|
88
143
|
// Annotate the CommonJS export names for ESM import in node:
|
|
89
144
|
0 && (module.exports = {
|
|
145
|
+
openBrowser,
|
|
90
146
|
pluginStartUrl,
|
|
91
147
|
replacePlaceholder
|
|
92
148
|
});
|
|
@@ -54,7 +54,6 @@ const applyDefaultPlugins = (plugins) => (0, import_shared.awaitableGetter)([
|
|
|
54
54
|
plugins.nodeAddons(),
|
|
55
55
|
// pug plugin should after html plugin
|
|
56
56
|
Promise.resolve().then(() => __toESM(require("../plugins/pug"))).then((m) => m.pluginPug()),
|
|
57
|
-
Promise.resolve().then(() => __toESM(require("../plugins/babel"))).then((m) => m.pluginBabel()),
|
|
58
57
|
plugins.define(),
|
|
59
58
|
Promise.resolve().then(() => __toESM(require("../plugins/css"))).then((m) => m.pluginCss()),
|
|
60
59
|
Promise.resolve().then(() => __toESM(require("../plugins/less"))).then((m) => m.pluginLess()),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright JS Foundation and other contributors.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file at
|
|
6
|
+
* https://github.com/jantimon/html-webpack-plugin/blob/main/LICENSE
|
|
7
|
+
*
|
|
8
|
+
* Modified from https://github.com/jantimon/html-webpack-plugin/blob/2f5de7ab9e8bca60e9e200f2e4b4cfab90db28d4/index.js#L800
|
|
9
|
+
*/
|
|
10
|
+
import type { MetaOptions } from '@rsbuild/shared';
|
|
11
|
+
export declare const generateMetaTags: (metaOptions?: MetaOptions) => string;
|
|
@@ -0,0 +1,64 @@
|
|
|
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 generateMetaTags_exports = {};
|
|
20
|
+
__export(generateMetaTags_exports, {
|
|
21
|
+
generateMetaTags: () => generateMetaTags
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(generateMetaTags_exports);
|
|
24
|
+
const tagObjectToString = (tagDefinition) => {
|
|
25
|
+
const attributes = Object.keys(tagDefinition.attributes || {}).filter(
|
|
26
|
+
(attributeName) => tagDefinition.attributes[attributeName] !== false
|
|
27
|
+
).map((attributeName) => {
|
|
28
|
+
if (tagDefinition.attributes[attributeName] === true) {
|
|
29
|
+
return attributeName;
|
|
30
|
+
}
|
|
31
|
+
return `${attributeName}="${tagDefinition.attributes[attributeName]}"`;
|
|
32
|
+
});
|
|
33
|
+
return `<${[tagDefinition.tagName].concat(attributes).join(" ")}>${tagDefinition.innerHTML || ""}${tagDefinition.voidTag ? "" : `</${tagDefinition.tagName}>`}`;
|
|
34
|
+
};
|
|
35
|
+
const generateMetaTags = (metaOptions) => {
|
|
36
|
+
if (!metaOptions) {
|
|
37
|
+
return "";
|
|
38
|
+
}
|
|
39
|
+
const metaTagAttributeObjects = Object.keys(metaOptions).map((metaName) => {
|
|
40
|
+
const metaTagContent = metaOptions[metaName];
|
|
41
|
+
return typeof metaTagContent === "string" ? {
|
|
42
|
+
name: metaName,
|
|
43
|
+
content: metaTagContent
|
|
44
|
+
} : metaTagContent;
|
|
45
|
+
}).filter((attribute) => attribute !== false);
|
|
46
|
+
return metaTagAttributeObjects.map((metaTagAttributes) => {
|
|
47
|
+
if (metaTagAttributes === false) {
|
|
48
|
+
throw new Error("Invalid meta tag");
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
tagName: "meta",
|
|
52
|
+
voidTag: true,
|
|
53
|
+
attributes: metaTagAttributes
|
|
54
|
+
};
|
|
55
|
+
}).reduce(
|
|
56
|
+
(memo, tagObject) => `${memo}
|
|
57
|
+
${tagObjectToString(tagObject)}`,
|
|
58
|
+
""
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
generateMetaTags
|
|
64
|
+
});
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"node": ">=14.0.0"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"version": "0.0.
|
|
20
|
+
"version": "0.0.10",
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"main": "./dist/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"provenance": true
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@modern-js/server": "^2.
|
|
71
|
+
"@modern-js/server": "^2.39.0",
|
|
72
72
|
"@rspack/core": "0.3.8",
|
|
73
73
|
"@rspack/dev-client": "0.3.8",
|
|
74
74
|
"@rspack/plugin-html": "0.3.8",
|
|
@@ -77,13 +77,14 @@
|
|
|
77
77
|
"gzip-size": "^6.0.0",
|
|
78
78
|
"jiti": "^1.20.0",
|
|
79
79
|
"lodash": "^4.17.21",
|
|
80
|
+
"open": "^8.4.0",
|
|
80
81
|
"pkg-up": "^3.1.0",
|
|
81
82
|
"postcss": "8.4.31",
|
|
82
83
|
"rspack-manifest-plugin": "5.0.0-alpha0",
|
|
83
84
|
"semver": "^7.5.4",
|
|
84
85
|
"strip-ansi": "^6.0.1",
|
|
85
86
|
"webpack": "^5.88.1",
|
|
86
|
-
"@rsbuild/shared": "0.0.
|
|
87
|
+
"@rsbuild/shared": "0.0.10"
|
|
87
88
|
},
|
|
88
89
|
"devDependencies": {
|
|
89
90
|
"@types/lodash": "^4.14.200",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RsbuildPlugin } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* The `@babel/preset-typescript` default options.
|
|
4
|
-
*/
|
|
5
|
-
export declare const DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: {
|
|
6
|
-
allowNamespaces: boolean;
|
|
7
|
-
allExtensions: boolean;
|
|
8
|
-
allowDeclareFields: boolean;
|
|
9
|
-
optimizeConstEnums: boolean;
|
|
10
|
-
isTSX: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const pluginBabel: () => RsbuildPlugin;
|
|
@@ -1,130 +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 babel_exports = {};
|
|
30
|
-
__export(babel_exports, {
|
|
31
|
-
DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: () => DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS,
|
|
32
|
-
pluginBabel: () => pluginBabel
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(babel_exports);
|
|
35
|
-
var import_shared = require("@rsbuild/shared");
|
|
36
|
-
var import_lodash = require("lodash");
|
|
37
|
-
const DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
|
|
38
|
-
allowNamespaces: true,
|
|
39
|
-
allExtensions: true,
|
|
40
|
-
allowDeclareFields: true,
|
|
41
|
-
// aligns Babel's behavior with TypeScript's default behavior.
|
|
42
|
-
// https://babeljs.io/docs/en/babel-preset-typescript#optimizeconstenums
|
|
43
|
-
optimizeConstEnums: true,
|
|
44
|
-
isTSX: true
|
|
45
|
-
};
|
|
46
|
-
const pluginBabel = () => ({
|
|
47
|
-
name: "plugin-babel",
|
|
48
|
-
pre: ["plugin-swc"],
|
|
49
|
-
setup(api) {
|
|
50
|
-
api.modifyBundlerChain(
|
|
51
|
-
async (chain, { CHAIN_ID, isProd, getCompiledPath }) => {
|
|
52
|
-
const config = api.getNormalizedConfig();
|
|
53
|
-
if (!config.tools.babel) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const getBabelOptions = (config2) => {
|
|
57
|
-
const includes2 = [];
|
|
58
|
-
const excludes2 = [];
|
|
59
|
-
const babelUtils = {
|
|
60
|
-
addIncludes(items) {
|
|
61
|
-
if (Array.isArray(items)) {
|
|
62
|
-
includes2.push(...items);
|
|
63
|
-
} else {
|
|
64
|
-
includes2.push(items);
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
addExcludes(items) {
|
|
68
|
-
if (Array.isArray(items)) {
|
|
69
|
-
excludes2.push(...items);
|
|
70
|
-
} else {
|
|
71
|
-
excludes2.push(items);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const baseConfig = {
|
|
76
|
-
plugins: [],
|
|
77
|
-
presets: [
|
|
78
|
-
// TODO: only apply preset-typescript for ts file (isTSX & allExtensions false)
|
|
79
|
-
[
|
|
80
|
-
require.resolve("@babel/preset-typescript"),
|
|
81
|
-
DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS
|
|
82
|
-
]
|
|
83
|
-
]
|
|
84
|
-
};
|
|
85
|
-
const userBabelConfig = (0, import_shared.applyUserBabelConfig)(
|
|
86
|
-
(0, import_lodash.cloneDeep)(baseConfig),
|
|
87
|
-
config2.tools.babel,
|
|
88
|
-
babelUtils
|
|
89
|
-
);
|
|
90
|
-
const notModify = (0, import_lodash.isEqual)(baseConfig, userBabelConfig) && !(includes2 == null ? void 0 : includes2.length) && !(excludes2 == null ? void 0 : excludes2.length);
|
|
91
|
-
if (notModify) {
|
|
92
|
-
return {};
|
|
93
|
-
}
|
|
94
|
-
const babelOptions2 = {
|
|
95
|
-
babelrc: false,
|
|
96
|
-
configFile: false,
|
|
97
|
-
compact: isProd,
|
|
98
|
-
...userBabelConfig
|
|
99
|
-
};
|
|
100
|
-
return {
|
|
101
|
-
babelOptions: babelOptions2,
|
|
102
|
-
includes: includes2,
|
|
103
|
-
excludes: excludes2
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
const {
|
|
107
|
-
babelOptions,
|
|
108
|
-
includes = [],
|
|
109
|
-
excludes = []
|
|
110
|
-
} = getBabelOptions(config);
|
|
111
|
-
if (!babelOptions) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const rule = chain.module.rule(CHAIN_ID.RULE.JS);
|
|
115
|
-
includes.forEach((condition) => {
|
|
116
|
-
rule.include.add(condition);
|
|
117
|
-
});
|
|
118
|
-
excludes.forEach((condition) => {
|
|
119
|
-
rule.exclude.add(condition);
|
|
120
|
-
});
|
|
121
|
-
rule.test((0, import_shared.mergeRegex)(import_shared.JS_REGEX, import_shared.TS_REGEX)).use(CHAIN_ID.USE.BABEL).after(CHAIN_ID.USE.SWC).loader(getCompiledPath("babel-loader")).options(babelOptions);
|
|
122
|
-
}
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
127
|
-
0 && (module.exports = {
|
|
128
|
-
DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS,
|
|
129
|
-
pluginBabel
|
|
130
|
-
});
|