@gct-paas/build 0.1.4-dev.3 → 0.1.4-dev.4
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/constants/index.cjs +1 -1
- package/dist/rollup/rollup-config/dev-config.cjs +10 -1
- package/dist/util/index.cjs +8 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/reg-exp/reg-exp.cjs +7 -0
- package/dist/util/reg-exp/reg-exp.d.ts +1 -0
- package/es/constants/index.mjs +1 -0
- package/es/rollup/rollup-config/dev-config.mjs +11 -2
- package/es/util/index.d.ts +1 -0
- package/es/util/index.mjs +2 -1
- package/es/util/reg-exp/reg-exp.d.ts +1 -0
- package/es/util/reg-exp/reg-exp.mjs +1 -0
- package/package.json +3 -3
package/dist/constants/index.cjs
CHANGED
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.PROD_MODE = exports.DEV_MODE = exports.DEFAULT_EXTERNAL = void 0;
|
|
7
7
|
const DEV_MODE = exports.DEV_MODE = "development";
|
|
8
8
|
const PROD_MODE = exports.PROD_MODE = "production";
|
|
9
|
-
const DEFAULT_EXTERNAL = exports.DEFAULT_EXTERNAL = ["vue", "vue-router", "vue-i18n", "axios", "dayjs", "lodash-es", "qs", "pinia", "vuedraggable", "sortablejs", "vue-grid-layout", "vant", "ant-design-vue", "@gct-paas/build", "@gct-paas/core", "@gct-paas/core-mobile", "@gct-paas/core-web", "@gct-paas/design", "@gct-paas/design-mobile", "@gct-paas/design-web", "@gct-paas/mobile", "@gct-paas/scss", "@gct-paas/web", "systemjs"];
|
|
9
|
+
const DEFAULT_EXTERNAL = exports.DEFAULT_EXTERNAL = ["vue", "vue-router", "vue-i18n", "axios", "dayjs", "lodash-es", "qs", "pinia", "vuedraggable", "sortablejs", "vue-grid-layout", "vant", "ant-design-vue", "@gct-paas/build", "@gct-paas/api", "@gct-paas/core", "@gct-paas/core-mobile", "@gct-paas/core-web", "@gct-paas/design", "@gct-paas/design-mobile", "@gct-paas/design-web", "@gct-paas/mobile", "@gct-paas/scss", "@gct-paas/web", "systemjs"];
|
|
@@ -73,6 +73,7 @@ function defineRollupConfig(opts = {}) {
|
|
|
73
73
|
}
|
|
74
74
|
const output = [{
|
|
75
75
|
dir: outDir,
|
|
76
|
+
esModule: true,
|
|
76
77
|
format: "es",
|
|
77
78
|
sourcemap: false,
|
|
78
79
|
preserveModules: true,
|
|
@@ -82,7 +83,15 @@ function defineRollupConfig(opts = {}) {
|
|
|
82
83
|
return (0, _util.mergeConfig)((0, _rollup.defineConfig)({
|
|
83
84
|
input,
|
|
84
85
|
treeshake: false,
|
|
85
|
-
external:
|
|
86
|
+
external: id => {
|
|
87
|
+
if (_util.IS_NODE_MODULE.test(id)) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
if (_constants.DEFAULT_EXTERNAL.includes(id)) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
},
|
|
86
95
|
output,
|
|
87
96
|
plugins: [(0, _rollupPlugins.ignoreCompilerFile)(externalCompileFileReg), (0, _pluginJson.default)(), (0, _pluginVue.default)({
|
|
88
97
|
isProduction: isProd
|
package/dist/util/index.cjs
CHANGED
|
@@ -9,10 +9,17 @@ Object.defineProperty(exports, "CopyWatch", {
|
|
|
9
9
|
return _watcher.CopyWatch;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "IS_NODE_MODULE", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _regExp.IS_NODE_MODULE;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
exports.mergeConfig = mergeConfig;
|
|
13
19
|
exports.unixToWinPath = unixToWinPath;
|
|
14
20
|
exports.winToUnixPath = winToUnixPath;
|
|
15
21
|
var _lodashEs = require("lodash-es");
|
|
22
|
+
var _regExp = require("./reg-exp/reg-exp.cjs");
|
|
16
23
|
var _watcher = require("./watcher/watcher.cjs");
|
|
17
24
|
function winToUnixPath(pathStr) {
|
|
18
25
|
return pathStr.replace(/\\/g, "/");
|
|
@@ -22,7 +29,7 @@ function unixToWinPath(pathStr) {
|
|
|
22
29
|
}
|
|
23
30
|
function mergeConfig(obj, obj2) {
|
|
24
31
|
return (0, _lodashEs.mergeWith)(obj, obj2, (objValue, srcValue) => {
|
|
25
|
-
if (Array.isArray(objValue)) {
|
|
32
|
+
if (Array.isArray(objValue) && Array.isArray(srcValue)) {
|
|
26
33
|
return objValue.concat(srcValue);
|
|
27
34
|
}
|
|
28
35
|
return void 0;
|
package/dist/util/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IS_NODE_MODULE: RegExp;
|
package/es/constants/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import fs from "fs-extra";
|
|
|
14
14
|
import os from "os";
|
|
15
15
|
import { copyFile, ignoreCompilerFile } from "../rollup-plugins/index.mjs";
|
|
16
16
|
import { DEFAULT_EXTERNAL, PROD_MODE } from "../../constants/index.mjs";
|
|
17
|
-
import { mergeConfig, winToUnixPath } from "../../util/index.mjs";
|
|
17
|
+
import { IS_NODE_MODULE, mergeConfig, winToUnixPath } from "../../util/index.mjs";
|
|
18
18
|
export function defineRollupConfig(opts = {}) {
|
|
19
19
|
process.on("SIGINT", () => {
|
|
20
20
|
process.exit();
|
|
@@ -71,6 +71,7 @@ export function defineRollupConfig(opts = {}) {
|
|
|
71
71
|
const output = [
|
|
72
72
|
{
|
|
73
73
|
dir: outDir,
|
|
74
|
+
esModule: true,
|
|
74
75
|
format: "es",
|
|
75
76
|
sourcemap: false,
|
|
76
77
|
preserveModules: true,
|
|
@@ -82,7 +83,15 @@ export function defineRollupConfig(opts = {}) {
|
|
|
82
83
|
defineConfig({
|
|
83
84
|
input,
|
|
84
85
|
treeshake: false,
|
|
85
|
-
external:
|
|
86
|
+
external: (id) => {
|
|
87
|
+
if (IS_NODE_MODULE.test(id)) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
if (DEFAULT_EXTERNAL.includes(id)) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
},
|
|
86
95
|
output,
|
|
87
96
|
plugins: [
|
|
88
97
|
ignoreCompilerFile(externalCompileFileReg),
|
package/es/util/index.d.ts
CHANGED
package/es/util/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mergeWith } from "lodash-es";
|
|
2
|
+
export { IS_NODE_MODULE } from "./reg-exp/reg-exp.mjs";
|
|
2
3
|
export { CopyWatch } from "./watcher/watcher.mjs";
|
|
3
4
|
export function winToUnixPath(pathStr) {
|
|
4
5
|
return pathStr.replace(/\\/g, "/");
|
|
@@ -8,7 +9,7 @@ export function unixToWinPath(pathStr) {
|
|
|
8
9
|
}
|
|
9
10
|
export function mergeConfig(obj, obj2) {
|
|
10
11
|
return mergeWith(obj, obj2, (objValue, srcValue) => {
|
|
11
|
-
if (Array.isArray(objValue)) {
|
|
12
|
+
if (Array.isArray(objValue) && Array.isArray(srcValue)) {
|
|
12
13
|
return objValue.concat(srcValue);
|
|
13
14
|
}
|
|
14
15
|
return void 0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IS_NODE_MODULE: RegExp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const IS_NODE_MODULE = /node_modules\//;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/build",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@commitlint/cli": "^19.8.1",
|
|
45
45
|
"@commitlint/config-conventional": "^19.8.1",
|
|
46
46
|
"@eslint/js": "^9.33.0",
|
|
47
|
-
"@gct-paas/scss": "^0.1.4-dev.
|
|
47
|
+
"@gct-paas/scss": "^0.1.4-dev.4",
|
|
48
48
|
"@inquirer/prompts": "^7.8.3",
|
|
49
49
|
"@rollup/plugin-babel": "^6.0.4",
|
|
50
50
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"typescript": "^5.9.2",
|
|
99
99
|
"unbuild": "^3.6.1"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "8243f48a5c33973e9d610917555d9a3e27e6bd04"
|
|
102
102
|
}
|