@gct-paas/build 0.1.4-dev.6 → 0.1.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/index.cjs +8 -0
- package/dist/rollup/index.d.ts +1 -0
- package/dist/rollup/rollup-config/build-config.cjs +60 -0
- package/dist/rollup/rollup-config/build-config.d.ts +9 -0
- package/dist/rollup/rollup-config/dev-config.cjs +1 -8
- package/dist/stylelint/stylelint-config/stylelint-config.cjs +6 -1
- package/dist/vite/vite-config/vite-config.cjs +5 -1
- package/dist/vite/vite-config/vite-plugin-config.cjs +4 -1
- package/dist/vite/vite-config/vite-project-config.cjs +3 -3
- package/es/constants/index.mjs +3 -1
- package/es/rollup/index.d.ts +1 -0
- package/es/rollup/index.mjs +1 -0
- package/es/rollup/rollup-config/build-config.d.ts +9 -0
- package/es/rollup/rollup-config/build-config.mjs +67 -0
- package/es/rollup/rollup-config/dev-config.mjs +1 -8
- package/es/stylelint/stylelint-config/stylelint-config.mjs +9 -1
- package/es/vite/vite-config/vite-config.mjs +5 -1
- package/es/vite/vite-config/vite-plugin-config.mjs +4 -1
- package/es/vite/vite-config/vite-project-config.mjs +5 -3
- package/package.json +47 -43
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/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"];
|
|
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/apaas", "@gct-paas/api/ipaas", "@gct-paas/api/platform", "@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"];
|
package/dist/rollup/index.cjs
CHANGED
|
@@ -4,14 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
+
defineRollupBuildConfig: true,
|
|
7
8
|
defineRollupConfig: true
|
|
8
9
|
};
|
|
10
|
+
Object.defineProperty(exports, "defineRollupBuildConfig", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _buildConfig.defineRollupBuildConfig;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
9
16
|
Object.defineProperty(exports, "defineRollupConfig", {
|
|
10
17
|
enumerable: true,
|
|
11
18
|
get: function () {
|
|
12
19
|
return _devConfig.defineRollupConfig;
|
|
13
20
|
}
|
|
14
21
|
});
|
|
22
|
+
var _buildConfig = require("./rollup-config/build-config.cjs");
|
|
15
23
|
var _devConfig = require("./rollup-config/dev-config.cjs");
|
|
16
24
|
var _rollupPlugins = require("./rollup-plugins/index.cjs");
|
|
17
25
|
Object.keys(_rollupPlugins).forEach(function (key) {
|
package/dist/rollup/index.d.ts
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defineRollupBuildConfig = defineRollupBuildConfig;
|
|
7
|
+
var _rollup = require("rollup");
|
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
|
9
|
+
var _pluginNodeResolve = require("@rollup/plugin-node-resolve");
|
|
10
|
+
var _pluginCommonjs = _interopRequireDefault(require("@rollup/plugin-commonjs"));
|
|
11
|
+
var _pluginJson = _interopRequireDefault(require("@rollup/plugin-json"));
|
|
12
|
+
var _rollupPluginEsbuild = _interopRequireWildcard(require("rollup-plugin-esbuild"));
|
|
13
|
+
var _pluginVue = _interopRequireDefault(require("@vitejs/plugin-vue"));
|
|
14
|
+
var _pluginVueJsx = _interopRequireDefault(require("@vitejs/plugin-vue-jsx"));
|
|
15
|
+
var rf = _interopRequireWildcard(require("rimraf"));
|
|
16
|
+
var _rollupPlugins = require("../rollup-plugins/index.cjs");
|
|
17
|
+
var _constants = require("../../constants/index.cjs");
|
|
18
|
+
var _util = require("../../util/index.cjs");
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
function defineRollupBuildConfig(opts = {}) {
|
|
23
|
+
process.on("SIGINT", () => {
|
|
24
|
+
process.exit();
|
|
25
|
+
});
|
|
26
|
+
const cwd = process.cwd();
|
|
27
|
+
const isProd = process.env.NODE_ENV === _constants.PROD_MODE;
|
|
28
|
+
const outDir = _path.default.resolve(cwd, "es");
|
|
29
|
+
const externalCompileFileReg = /\.(d\.ts)+$/;
|
|
30
|
+
rf.sync(outDir);
|
|
31
|
+
const output = [{
|
|
32
|
+
file: "dist/index.esm.min.js",
|
|
33
|
+
format: "es"
|
|
34
|
+
}, {
|
|
35
|
+
file: "dist/index.system.min.js",
|
|
36
|
+
format: "system"
|
|
37
|
+
}, {
|
|
38
|
+
file: "dist/index.cjs.min.js",
|
|
39
|
+
format: "cjs",
|
|
40
|
+
exports: "named"
|
|
41
|
+
}];
|
|
42
|
+
return (0, _util.mergeConfig)((0, _rollup.defineConfig)({
|
|
43
|
+
input: "src/index.ts",
|
|
44
|
+
treeshake: false,
|
|
45
|
+
external: _constants.DEFAULT_EXTERNAL,
|
|
46
|
+
output,
|
|
47
|
+
plugins: [(0, _rollupPlugins.ignoreCompilerFile)(externalCompileFileReg), (0, _pluginJson.default)(), (0, _pluginVue.default)({
|
|
48
|
+
isProduction: isProd
|
|
49
|
+
}), (0, _pluginVueJsx.default)({}), (0, _pluginNodeResolve.nodeResolve)({
|
|
50
|
+
extensions: [".cjs", ".mjs", ".js", ".ts"]
|
|
51
|
+
}), (0, _pluginCommonjs.default)(), (0, _rollupPluginEsbuild.default)({
|
|
52
|
+
logLevel: "verbose",
|
|
53
|
+
sourceMap: false,
|
|
54
|
+
target: ["esnext"],
|
|
55
|
+
loaders: {
|
|
56
|
+
".vue": "ts"
|
|
57
|
+
}
|
|
58
|
+
}), (0, _rollupPluginEsbuild.minify)()]
|
|
59
|
+
}), opts);
|
|
60
|
+
}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.defineRollupConfig = defineRollupConfig;
|
|
7
7
|
var _rollup = require("rollup");
|
|
8
8
|
var _path = _interopRequireDefault(require("path"));
|
|
9
|
-
var _fastGlob = _interopRequireDefault(require("fast-glob"));
|
|
10
9
|
var _pluginNodeResolve = require("@rollup/plugin-node-resolve");
|
|
11
10
|
var _pluginCommonjs = _interopRequireDefault(require("@rollup/plugin-commonjs"));
|
|
12
11
|
var _pluginJson = _interopRequireDefault(require("@rollup/plugin-json"));
|
|
@@ -35,12 +34,6 @@ function defineRollupConfig(opts = {}) {
|
|
|
35
34
|
const assetsDir = _path.default.resolve(cwd, "public");
|
|
36
35
|
const externalCompileFileReg = /\.(vue|scss|css|less|d\.ts)+$/;
|
|
37
36
|
rf.sync(outDir);
|
|
38
|
-
const input = _fastGlob.default.sync("src/**/*.{ts,tsx}", {
|
|
39
|
-
cwd,
|
|
40
|
-
absolute: true,
|
|
41
|
-
onlyFiles: true,
|
|
42
|
-
ignore: ["**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
|
|
43
|
-
});
|
|
44
37
|
if (isProd) {
|
|
45
38
|
const isWin = _os.default.platform() === "win32";
|
|
46
39
|
if (isWin) {
|
|
@@ -81,7 +74,7 @@ function defineRollupConfig(opts = {}) {
|
|
|
81
74
|
entryFileNames: "[name].mjs"
|
|
82
75
|
}];
|
|
83
76
|
return (0, _util.mergeConfig)((0, _rollup.defineConfig)({
|
|
84
|
-
input,
|
|
77
|
+
input: "src/index.ts",
|
|
85
78
|
treeshake: false,
|
|
86
79
|
external: id => {
|
|
87
80
|
if (_util.IS_NODE_MODULE.test(id)) {
|
|
@@ -17,8 +17,13 @@ function defineStylelintConfig(config = {}) {
|
|
|
17
17
|
"selector-class-pattern": null,
|
|
18
18
|
"scss/dollar-variable-pattern": null,
|
|
19
19
|
"scss/at-function-pattern": null,
|
|
20
|
-
"scss/dollar-variable-empty-line-before": null
|
|
20
|
+
"scss/dollar-variable-empty-line-before": null,
|
|
21
21
|
// 变量声明之间不可以有空白行
|
|
22
|
+
"nesting-selector-no-missing-scoping-root": null,
|
|
23
|
+
"selector-pseudo-class-no-unknown": [true, {
|
|
24
|
+
// css modules 的 :global 伪类
|
|
25
|
+
ignorePseudoClasses: ["global"]
|
|
26
|
+
}]
|
|
22
27
|
}
|
|
23
28
|
}, config);
|
|
24
29
|
}
|
|
@@ -24,7 +24,8 @@ function defineViteConfig(opts = {}) {
|
|
|
24
24
|
},
|
|
25
25
|
lib: {
|
|
26
26
|
entry: _path.default.resolve(cwd, "src/index.ts"),
|
|
27
|
-
formats: ["system", "cjs"],
|
|
27
|
+
formats: ["system", "cjs", "es"],
|
|
28
|
+
cssFileName: "index.min.css",
|
|
28
29
|
fileName(format) {
|
|
29
30
|
if (format === "system" || format === "systemjs") {
|
|
30
31
|
return `[name].system.min.js`;
|
|
@@ -32,6 +33,9 @@ function defineViteConfig(opts = {}) {
|
|
|
32
33
|
if (format === "cjs" || format === "commonjs") {
|
|
33
34
|
return `[name].min.cjs`;
|
|
34
35
|
}
|
|
36
|
+
if (format === "es" || format === "esm" || format === "module") {
|
|
37
|
+
return `[name].esm.min.mjs`;
|
|
38
|
+
}
|
|
35
39
|
return `[name].${format}.min.js`;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
@@ -10,7 +10,7 @@ var _vite = require("vite");
|
|
|
10
10
|
var _path = _interopRequireDefault(require("path"));
|
|
11
11
|
var _viteBaseConfig = require("./vite-base-config.cjs");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const formats = ["system", "cjs"];
|
|
13
|
+
const formats = ["system", "cjs", "es"];
|
|
14
14
|
function formatFileName(format) {
|
|
15
15
|
if (format === "system" || format === "systemjs") {
|
|
16
16
|
return `[name].system.min.js`;
|
|
@@ -18,6 +18,9 @@ function formatFileName(format) {
|
|
|
18
18
|
if (format === "cjs" || format === "commonjs") {
|
|
19
19
|
return `[name].min.cjs`;
|
|
20
20
|
}
|
|
21
|
+
if (format === "es" || format === "esm" || format === "module") {
|
|
22
|
+
return `[name].esm.min.mjs`;
|
|
23
|
+
}
|
|
21
24
|
return `[name].${format}.min.js`;
|
|
22
25
|
}
|
|
23
26
|
function assetFileNames(assetInfo, name) {
|
|
@@ -54,7 +54,7 @@ function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
|
54
54
|
},
|
|
55
55
|
build: {
|
|
56
56
|
rollupOptions: {
|
|
57
|
-
external: ["axios", "dayjs", "pinia", "lodash-es", "vue", "vue-i18n", "vue-router", "ant-design-vue", "pinia", "systemjs", "@gct-paas/core", "@gct-paas/core-web", "@gct-paas/api"]
|
|
57
|
+
external: ["axios", "dayjs", "pinia", "lodash-es", "vue", "vue-i18n", "vue-router", "ant-design-vue", "pinia", "systemjs", "@gct-paas/core", "@gct-paas/core-web", "@gct-paas/api/apaas", "@gct-paas/api/ipaas", "@gct-paas/api/platform"]
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
css: {
|
|
@@ -87,8 +87,8 @@ function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
|
87
87
|
plugins: [(0, _pluginJson.default)(), (0, _pluginVue.default)(), (0, _pluginVueJsx.default)(), (0, _pluginLegacy.default)({
|
|
88
88
|
targets: ["chrome>=85", "edge>=85", "firefox>=79", "safari>=14.1"],
|
|
89
89
|
externalSystemJS: true,
|
|
90
|
-
//
|
|
91
|
-
renderModernChunks:
|
|
90
|
+
// 关键配置:false 时只生成 legacy 版本
|
|
91
|
+
renderModernChunks: true
|
|
92
92
|
})]
|
|
93
93
|
}, opts);
|
|
94
94
|
});
|
package/es/constants/index.mjs
CHANGED
|
@@ -15,7 +15,9 @@ export const DEFAULT_EXTERNAL = [
|
|
|
15
15
|
"vant",
|
|
16
16
|
"ant-design-vue",
|
|
17
17
|
"@gct-paas/build",
|
|
18
|
-
"@gct-paas/api",
|
|
18
|
+
"@gct-paas/api/apaas",
|
|
19
|
+
"@gct-paas/api/ipaas",
|
|
20
|
+
"@gct-paas/api/platform",
|
|
19
21
|
"@gct-paas/core",
|
|
20
22
|
"@gct-paas/core-mobile",
|
|
21
23
|
"@gct-paas/core-web",
|
package/es/rollup/index.d.ts
CHANGED
package/es/rollup/index.mjs
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineConfig } from "rollup";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
4
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
5
|
+
import json from "@rollup/plugin-json";
|
|
6
|
+
import esbuild, { minify } from "rollup-plugin-esbuild";
|
|
7
|
+
import vue from "@vitejs/plugin-vue";
|
|
8
|
+
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
9
|
+
import * as rf from "rimraf";
|
|
10
|
+
import { ignoreCompilerFile } from "../rollup-plugins/index.mjs";
|
|
11
|
+
import { DEFAULT_EXTERNAL, PROD_MODE } from "../../constants/index.mjs";
|
|
12
|
+
import { mergeConfig } from "../../util/index.mjs";
|
|
13
|
+
export function defineRollupBuildConfig(opts = {}) {
|
|
14
|
+
process.on("SIGINT", () => {
|
|
15
|
+
process.exit();
|
|
16
|
+
});
|
|
17
|
+
const cwd = process.cwd();
|
|
18
|
+
const isProd = process.env.NODE_ENV === PROD_MODE;
|
|
19
|
+
const outDir = path.resolve(cwd, "es");
|
|
20
|
+
const externalCompileFileReg = /\.(d\.ts)+$/;
|
|
21
|
+
rf.sync(outDir);
|
|
22
|
+
const output = [
|
|
23
|
+
{
|
|
24
|
+
file: "dist/index.esm.min.js",
|
|
25
|
+
format: "es"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
file: "dist/index.system.min.js",
|
|
29
|
+
format: "system"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
file: "dist/index.cjs.min.js",
|
|
33
|
+
format: "cjs",
|
|
34
|
+
exports: "named"
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
return mergeConfig(
|
|
38
|
+
defineConfig({
|
|
39
|
+
input: "src/index.ts",
|
|
40
|
+
treeshake: false,
|
|
41
|
+
external: DEFAULT_EXTERNAL,
|
|
42
|
+
output,
|
|
43
|
+
plugins: [
|
|
44
|
+
ignoreCompilerFile(externalCompileFileReg),
|
|
45
|
+
json(),
|
|
46
|
+
vue({
|
|
47
|
+
isProduction: isProd
|
|
48
|
+
}),
|
|
49
|
+
vueJsx({}),
|
|
50
|
+
nodeResolve({
|
|
51
|
+
extensions: [".cjs", ".mjs", ".js", ".ts"]
|
|
52
|
+
}),
|
|
53
|
+
commonjs(),
|
|
54
|
+
esbuild({
|
|
55
|
+
logLevel: "verbose",
|
|
56
|
+
sourceMap: false,
|
|
57
|
+
target: ["esnext"],
|
|
58
|
+
loaders: {
|
|
59
|
+
".vue": "ts"
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
minify()
|
|
63
|
+
]
|
|
64
|
+
}),
|
|
65
|
+
opts
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from "rollup";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import glob from "fast-glob";
|
|
4
3
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
5
4
|
import commonjs from "@rollup/plugin-commonjs";
|
|
6
5
|
import json from "@rollup/plugin-json";
|
|
@@ -26,12 +25,6 @@ export function defineRollupConfig(opts = {}) {
|
|
|
26
25
|
const assetsDir = path.resolve(cwd, "public");
|
|
27
26
|
const externalCompileFileReg = /\.(vue|scss|css|less|d\.ts)+$/;
|
|
28
27
|
rf.sync(outDir);
|
|
29
|
-
const input = glob.sync("src/**/*.{ts,tsx}", {
|
|
30
|
-
cwd,
|
|
31
|
-
absolute: true,
|
|
32
|
-
onlyFiles: true,
|
|
33
|
-
ignore: ["**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
|
|
34
|
-
});
|
|
35
28
|
if (isProd) {
|
|
36
29
|
const isWin = os.platform() === "win32";
|
|
37
30
|
if (isWin) {
|
|
@@ -81,7 +74,7 @@ export function defineRollupConfig(opts = {}) {
|
|
|
81
74
|
];
|
|
82
75
|
return mergeConfig(
|
|
83
76
|
defineConfig({
|
|
84
|
-
input,
|
|
77
|
+
input: "src/index.ts",
|
|
85
78
|
treeshake: false,
|
|
86
79
|
external: (id) => {
|
|
87
80
|
if (IS_NODE_MODULE.test(id)) {
|
|
@@ -12,8 +12,16 @@ export function defineStylelintConfig(config = {}) {
|
|
|
12
12
|
"selector-class-pattern": null,
|
|
13
13
|
"scss/dollar-variable-pattern": null,
|
|
14
14
|
"scss/at-function-pattern": null,
|
|
15
|
-
"scss/dollar-variable-empty-line-before": null
|
|
15
|
+
"scss/dollar-variable-empty-line-before": null,
|
|
16
16
|
// 变量声明之间不可以有空白行
|
|
17
|
+
"nesting-selector-no-missing-scoping-root": null,
|
|
18
|
+
"selector-pseudo-class-no-unknown": [
|
|
19
|
+
true,
|
|
20
|
+
{
|
|
21
|
+
// css modules 的 :global 伪类
|
|
22
|
+
ignorePseudoClasses: ["global"]
|
|
23
|
+
}
|
|
24
|
+
]
|
|
17
25
|
}
|
|
18
26
|
},
|
|
19
27
|
config
|
|
@@ -17,7 +17,8 @@ export function defineViteConfig(opts = {}) {
|
|
|
17
17
|
},
|
|
18
18
|
lib: {
|
|
19
19
|
entry: path.resolve(cwd, "src/index.ts"),
|
|
20
|
-
formats: ["system", "cjs"],
|
|
20
|
+
formats: ["system", "cjs", "es"],
|
|
21
|
+
cssFileName: "index.min.css",
|
|
21
22
|
fileName(format) {
|
|
22
23
|
if (format === "system" || format === "systemjs") {
|
|
23
24
|
return `[name].system.min.js`;
|
|
@@ -25,6 +26,9 @@ export function defineViteConfig(opts = {}) {
|
|
|
25
26
|
if (format === "cjs" || format === "commonjs") {
|
|
26
27
|
return `[name].min.cjs`;
|
|
27
28
|
}
|
|
29
|
+
if (format === "es" || format === "esm" || format === "module") {
|
|
30
|
+
return `[name].esm.min.mjs`;
|
|
31
|
+
}
|
|
28
32
|
return `[name].${format}.min.js`;
|
|
29
33
|
}
|
|
30
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mergeConfig } from "vite";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { defineViteBaseConfig } from "./vite-base-config.mjs";
|
|
4
|
-
const formats = ["system", "cjs"];
|
|
4
|
+
const formats = ["system", "cjs", "es"];
|
|
5
5
|
function formatFileName(format) {
|
|
6
6
|
if (format === "system" || format === "systemjs") {
|
|
7
7
|
return `[name].system.min.js`;
|
|
@@ -9,6 +9,9 @@ function formatFileName(format) {
|
|
|
9
9
|
if (format === "cjs" || format === "commonjs") {
|
|
10
10
|
return `[name].min.cjs`;
|
|
11
11
|
}
|
|
12
|
+
if (format === "es" || format === "esm" || format === "module") {
|
|
13
|
+
return `[name].esm.min.mjs`;
|
|
14
|
+
}
|
|
12
15
|
return `[name].${format}.min.js`;
|
|
13
16
|
}
|
|
14
17
|
function assetFileNames(assetInfo, name) {
|
|
@@ -61,7 +61,9 @@ export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
|
61
61
|
"systemjs",
|
|
62
62
|
"@gct-paas/core",
|
|
63
63
|
"@gct-paas/core-web",
|
|
64
|
-
"@gct-paas/api"
|
|
64
|
+
"@gct-paas/api/apaas",
|
|
65
|
+
"@gct-paas/api/ipaas",
|
|
66
|
+
"@gct-paas/api/platform"
|
|
65
67
|
]
|
|
66
68
|
}
|
|
67
69
|
},
|
|
@@ -102,8 +104,8 @@ export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
|
102
104
|
legacy({
|
|
103
105
|
targets: ["chrome>=85", "edge>=85", "firefox>=79", "safari>=14.1"],
|
|
104
106
|
externalSystemJS: true,
|
|
105
|
-
//
|
|
106
|
-
renderModernChunks:
|
|
107
|
+
// 关键配置:false 时只生成 legacy 版本
|
|
108
|
+
renderModernChunks: true
|
|
107
109
|
})
|
|
108
110
|
]
|
|
109
111
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/build",
|
|
3
|
-
"version": "0.1.4
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -39,66 +39,70 @@
|
|
|
39
39
|
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@babel/core": "^7.28.
|
|
43
|
-
"@babel/preset-env": "^7.28.
|
|
44
|
-
"@commitlint/cli": "^
|
|
45
|
-
"@commitlint/config-conventional": "^
|
|
46
|
-
"@eslint/js": "^9.
|
|
47
|
-
"@gct-paas/scss": "^0.1.4-dev.
|
|
48
|
-
"@inquirer/prompts": "^
|
|
49
|
-
"@rollup/plugin-babel": "^6.0
|
|
50
|
-
"@rollup/plugin-commonjs": "^
|
|
51
|
-
"@rollup/plugin-eslint": "^9.0
|
|
42
|
+
"@babel/core": "^7.28.6",
|
|
43
|
+
"@babel/preset-env": "^7.28.6",
|
|
44
|
+
"@commitlint/cli": "^20.3.1",
|
|
45
|
+
"@commitlint/config-conventional": "^20.3.1",
|
|
46
|
+
"@eslint/js": "^9.39.2",
|
|
47
|
+
"@gct-paas/scss": "^0.1.4-dev.7",
|
|
48
|
+
"@inquirer/prompts": "^8.2.0",
|
|
49
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
50
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
51
|
+
"@rollup/plugin-eslint": "^9.2.0",
|
|
52
52
|
"@rollup/plugin-json": "^6.1.0",
|
|
53
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
54
|
-
"@rollup/plugin-typescript": "^12.
|
|
53
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
54
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
55
55
|
"@vitejs/plugin-legacy": "^7.2.1",
|
|
56
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
57
|
-
"@vitejs/plugin-vue-jsx": "^5.
|
|
58
|
-
"@vue/compiler-sfc": "^3.5.
|
|
59
|
-
"chokidar": "^
|
|
60
|
-
"commander": "^14.0.
|
|
56
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
57
|
+
"@vitejs/plugin-vue-jsx": "^5.1.3",
|
|
58
|
+
"@vue/compiler-sfc": "^3.5.27",
|
|
59
|
+
"chokidar": "^5.0.0",
|
|
60
|
+
"commander": "^14.0.2",
|
|
61
61
|
"consola": "^3.4.2",
|
|
62
62
|
"copy-file": "^11.1.0",
|
|
63
|
-
"core-js": "^3.
|
|
64
|
-
"cpy": "^12.0
|
|
63
|
+
"core-js": "^3.48.0",
|
|
64
|
+
"cpy": "^12.1.0",
|
|
65
65
|
"crypto": "^1.0.1",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
66
|
+
"cssnano": "^7.1.2",
|
|
67
|
+
"esbuild": "^0.27.2",
|
|
68
|
+
"eslint": "^9.39.2",
|
|
68
69
|
"eslint-config-prettier": "^10.1.8",
|
|
69
70
|
"eslint-plugin-import": "^2.32.0",
|
|
70
|
-
"eslint-plugin-prettier": "^5.5.
|
|
71
|
-
"eslint-plugin-unused-imports": "^4.
|
|
72
|
-
"eslint-plugin-vue": "^10.
|
|
71
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
72
|
+
"eslint-plugin-unused-imports": "^4.3.0",
|
|
73
|
+
"eslint-plugin-vue": "^10.7.0",
|
|
73
74
|
"fast-glob": "^3.3.3",
|
|
74
|
-
"fs-extra": "^11.3.
|
|
75
|
-
"globals": "^
|
|
76
|
-
"lodash-es": "^4.17.
|
|
77
|
-
"ora": "^
|
|
75
|
+
"fs-extra": "^11.3.3",
|
|
76
|
+
"globals": "^17.1.0",
|
|
77
|
+
"lodash-es": "^4.17.23",
|
|
78
|
+
"ora": "^9.1.0",
|
|
78
79
|
"picocolors": "^1.1.1",
|
|
79
|
-
"prettier": "^3.
|
|
80
|
-
"rimraf": "^6.
|
|
81
|
-
"rollup": "^4.
|
|
80
|
+
"prettier": "^3.8.1",
|
|
81
|
+
"rimraf": "^6.1.2",
|
|
82
|
+
"rollup": "^4.56.0",
|
|
82
83
|
"rollup-plugin-esbuild": "^6.2.1",
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
84
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
85
|
+
"sass": "^1.97.3",
|
|
86
|
+
"simple-git": "^3.30.0",
|
|
87
|
+
"stylelint": "^17.0.0",
|
|
88
|
+
"stylelint-config-standard-scss": "^17.0.0",
|
|
89
|
+
"typescript-eslint": "^8.53.1",
|
|
90
|
+
"vite": "^7.3.1",
|
|
88
91
|
"vite-plugin-dts": "^4.5.4",
|
|
89
92
|
"vue-eslint-parser": "^10.2.0",
|
|
90
|
-
"vue-tsc": "^3.
|
|
93
|
+
"vue-tsc": "^3.2.3"
|
|
91
94
|
},
|
|
92
95
|
"devDependencies": {
|
|
93
|
-
"@commitlint/types": "^
|
|
96
|
+
"@commitlint/types": "^20.3.1",
|
|
94
97
|
"@types/babel__core": "^7.20.5",
|
|
95
98
|
"@types/babel__preset-env": "^7.10.0",
|
|
96
99
|
"@types/fs-extra": "^11.0.4",
|
|
97
100
|
"@types/lodash-es": "^4.17.12",
|
|
98
|
-
"@types/node": "^
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
+
"@types/node": "^25.0.10",
|
|
102
|
+
"postcss": "^8.5.6",
|
|
103
|
+
"tsx": "^4.21.0",
|
|
104
|
+
"typescript": "^5.9.3",
|
|
101
105
|
"unbuild": "^3.6.1"
|
|
102
106
|
},
|
|
103
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "7f04ca4a10d5aa5466977c782663dff6e3965cef"
|
|
104
108
|
}
|