@rsbuild/plugin-source-build 0.3.0 → 0.3.2
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/index.d.ts +2 -2
- package/dist/index.js +6 -10
- package/dist/index.mjs +5 -9
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RsbuildPlugin } from '@rsbuild/core';
|
|
2
2
|
import { Project, ExtraMonorepoStrategies } from '@rsbuild/monorepo-utils';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
4
|
+
declare const PLUGIN_SOURCE_BUILD_NAME = "rsbuild:source-build";
|
|
5
5
|
declare const getSourceInclude: (options: {
|
|
6
6
|
projects: Project[];
|
|
7
7
|
sourceField: string;
|
|
@@ -22,4 +22,4 @@ interface PluginSourceBuildOptions {
|
|
|
22
22
|
}
|
|
23
23
|
declare function pluginSourceBuild(options?: PluginSourceBuildOptions): RsbuildPlugin;
|
|
24
24
|
|
|
25
|
-
export { PluginSourceBuildOptions, getSourceInclude,
|
|
25
|
+
export { PLUGIN_SOURCE_BUILD_NAME, PluginSourceBuildOptions, getSourceInclude, pluginSourceBuild };
|
package/dist/index.js
CHANGED
|
@@ -30,16 +30,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
+
PLUGIN_SOURCE_BUILD_NAME: () => PLUGIN_SOURCE_BUILD_NAME,
|
|
33
34
|
getSourceInclude: () => getSourceInclude,
|
|
34
|
-
pluginName: () => pluginName,
|
|
35
35
|
pluginSourceBuild: () => pluginSourceBuild
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(src_exports);
|
|
38
38
|
var import_fs = __toESM(require("fs"));
|
|
39
39
|
var import_path = __toESM(require("path"));
|
|
40
40
|
var import_shared = require("@rsbuild/shared");
|
|
41
|
+
var import_core = require("@rsbuild/core");
|
|
41
42
|
var import_monorepo_utils = require("@rsbuild/monorepo-utils");
|
|
42
|
-
var
|
|
43
|
+
var PLUGIN_SOURCE_BUILD_NAME = "rsbuild:source-build";
|
|
43
44
|
var getSourceInclude = async (options) => {
|
|
44
45
|
const { projects, sourceField } = options;
|
|
45
46
|
const includes = [];
|
|
@@ -56,13 +57,8 @@ function pluginSourceBuild(options) {
|
|
|
56
57
|
extraMonorepoStrategies
|
|
57
58
|
} = options ?? {};
|
|
58
59
|
return {
|
|
59
|
-
name:
|
|
60
|
-
pre: [
|
|
61
|
-
"rsbuild:babel",
|
|
62
|
-
"uni-builder:babel",
|
|
63
|
-
"uni-builder:ts-loader",
|
|
64
|
-
"rsbuild-webpack:swc"
|
|
65
|
-
],
|
|
60
|
+
name: PLUGIN_SOURCE_BUILD_NAME,
|
|
61
|
+
pre: [import_core.PLUGIN_BABEL_NAME, "uni-builder:babel", "uni-builder:ts-loader"],
|
|
66
62
|
setup(api) {
|
|
67
63
|
const projectRootPath = api.context.rootPath;
|
|
68
64
|
let projects = [];
|
|
@@ -119,7 +115,7 @@ function pluginSourceBuild(options) {
|
|
|
119
115
|
}
|
|
120
116
|
// Annotate the CommonJS export names for ESM import in node:
|
|
121
117
|
0 && (module.exports = {
|
|
118
|
+
PLUGIN_SOURCE_BUILD_NAME,
|
|
122
119
|
getSourceInclude,
|
|
123
|
-
pluginName,
|
|
124
120
|
pluginSourceBuild
|
|
125
121
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -10,11 +10,12 @@ global.require = createRequire(import.meta.url);
|
|
|
10
10
|
import fs from "fs";
|
|
11
11
|
import path2 from "path";
|
|
12
12
|
import { setConfig, TS_CONFIG_FILE } from "@rsbuild/shared";
|
|
13
|
+
import { PLUGIN_BABEL_NAME } from "@rsbuild/core";
|
|
13
14
|
import {
|
|
14
15
|
filterByField,
|
|
15
16
|
getDependentProjects
|
|
16
17
|
} from "@rsbuild/monorepo-utils";
|
|
17
|
-
var
|
|
18
|
+
var PLUGIN_SOURCE_BUILD_NAME = "rsbuild:source-build";
|
|
18
19
|
var getSourceInclude = async (options) => {
|
|
19
20
|
const { projects, sourceField } = options;
|
|
20
21
|
const includes = [];
|
|
@@ -31,13 +32,8 @@ function pluginSourceBuild(options) {
|
|
|
31
32
|
extraMonorepoStrategies
|
|
32
33
|
} = options ?? {};
|
|
33
34
|
return {
|
|
34
|
-
name:
|
|
35
|
-
pre: [
|
|
36
|
-
"rsbuild:babel",
|
|
37
|
-
"uni-builder:babel",
|
|
38
|
-
"uni-builder:ts-loader",
|
|
39
|
-
"rsbuild-webpack:swc"
|
|
40
|
-
],
|
|
35
|
+
name: PLUGIN_SOURCE_BUILD_NAME,
|
|
36
|
+
pre: [PLUGIN_BABEL_NAME, "uni-builder:babel", "uni-builder:ts-loader"],
|
|
41
37
|
setup(api) {
|
|
42
38
|
const projectRootPath = api.context.rootPath;
|
|
43
39
|
let projects = [];
|
|
@@ -93,7 +89,7 @@ function pluginSourceBuild(options) {
|
|
|
93
89
|
};
|
|
94
90
|
}
|
|
95
91
|
export {
|
|
92
|
+
PLUGIN_SOURCE_BUILD_NAME,
|
|
96
93
|
getSourceInclude,
|
|
97
|
-
pluginName,
|
|
98
94
|
pluginSourceBuild
|
|
99
95
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-source-build",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Source build plugin of Rsbuild",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"repository": {
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@rsbuild/
|
|
27
|
-
"@rsbuild/
|
|
26
|
+
"@rsbuild/monorepo-utils": "0.3.2",
|
|
27
|
+
"@rsbuild/shared": "0.3.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@babel/core": "^7.23.2",
|
|
31
31
|
"typescript": "^5.3.0",
|
|
32
|
-
"@rsbuild/core": "0.3.
|
|
33
|
-
"@rsbuild/plugin-babel": "0.3.
|
|
34
|
-
"@
|
|
32
|
+
"@rsbuild/core": "0.3.2",
|
|
33
|
+
"@rsbuild/plugin-babel": "0.3.2",
|
|
34
|
+
"@scripts/test-helper": "1.0.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@rsbuild/core": "0.x"
|