@gct-paas/build 0.1.5-dev.9 → 0.1.6-dev.1
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/eslint/eslint-config/eslint-config.cjs +1 -0
- package/dist/index.cjs +0 -11
- package/dist/index.d.ts +0 -1
- package/dist/vite/vite-config/vite-base-config.cjs +2 -24
- package/dist/vite/vite-config/vite-config.cjs +2 -18
- package/dist/vite/vite-config/vite-dev-config.cjs +1 -2
- package/dist/vite/vite-config/vite-pkg-dev-config.cjs +4 -6
- package/dist/vite/vite-config/vite-project-config.cjs +3 -41
- package/dist/vite/vite-config/vite-project-config.d.ts +1 -2
- package/es/constants/index.mjs +13 -3
- package/es/eslint/eslint-config/eslint-config.mjs +1 -0
- package/es/index.d.ts +0 -1
- package/es/index.mjs +0 -1
- package/es/vite/vite-config/vite-base-config.mjs +0 -22
- package/es/vite/vite-config/vite-config.mjs +2 -18
- package/es/vite/vite-config/vite-dev-config.mjs +1 -2
- package/es/vite/vite-config/vite-pkg-dev-config.mjs +2 -5
- package/es/vite/vite-config/vite-project-config.d.ts +1 -2
- package/es/vite/vite-config/vite-project-config.mjs +18 -46
- package/package.json +19 -34
- package/dist/rollup/index.cjs +0 -35
- package/dist/rollup/index.d.ts +0 -3
- package/dist/rollup/rollup-config/build-config.cjs +0 -60
- package/dist/rollup/rollup-config/build-config.d.ts +0 -9
- package/dist/rollup/rollup-config/dev-config.cjs +0 -107
- package/dist/rollup/rollup-config/dev-config.d.ts +0 -9
- package/dist/rollup/rollup-plugins/copy-file.cjs +0 -24
- package/dist/rollup/rollup-plugins/copy-file.d.ts +0 -37
- package/dist/rollup/rollup-plugins/ignore-compiler-file.cjs +0 -23
- package/dist/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
- package/dist/rollup/rollup-plugins/index.cjs +0 -19
- package/dist/rollup/rollup-plugins/index.d.ts +0 -2
- package/dist/vite/gct-opts.interface.cjs +0 -1
- package/dist/vite/gct-opts.interface.d.ts +0 -18
- package/es/rollup/index.d.ts +0 -3
- package/es/rollup/index.mjs +0 -3
- package/es/rollup/rollup-config/build-config.d.ts +0 -9
- package/es/rollup/rollup-config/build-config.mjs +0 -67
- package/es/rollup/rollup-config/dev-config.d.ts +0 -9
- package/es/rollup/rollup-config/dev-config.mjs +0 -124
- package/es/rollup/rollup-plugins/copy-file.d.ts +0 -37
- package/es/rollup/rollup-plugins/copy-file.mjs +0 -18
- package/es/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
- package/es/rollup/rollup-plugins/ignore-compiler-file.mjs +0 -17
- package/es/rollup/rollup-plugins/index.d.ts +0 -2
- package/es/rollup/rollup-plugins/index.mjs +0 -2
- package/es/vite/gct-opts.interface.d.ts +0 -18
- package/es/vite/gct-opts.interface.mjs +0 -0
package/dist/constants/index.cjs
CHANGED
|
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.PROD_MODE = exports.DEV_MODE = exports.DEFAULT_IGNORED_DEPENDENCIES = 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/core-pad", "@gct-paas/design", "@gct-paas/design-mobile", "@gct-paas/design-web", "@gct-paas/design-pad", "@gct-paas/mobile", "@gct-paas/
|
|
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", "@ant-design/icons-vue", "@icon-park/vue-next/es/all", "@icon-park/vue-next/icons.json", "bignumber.js", "wujie", "sql-formatter", "@gct-paas/build", "@gct-paas/api", "@gct-paas/core", "@gct-paas/core-mobile", "@gct-paas/core-web", "@gct-paas/core-pad", "@gct-paas/design", "@gct-paas/design-mobile", "@gct-paas/design-web", "@gct-paas/design-pad", "@gct-paas/render", "@gct-paas/render-mobile", "@gct-paas/render-pad", "@gct-paas/render-web", "@gct-paas/schema", "@gct-paas/scss", "@gct-paas/formula-editor", "@gct-paas/platform-icons", "systemjs"];
|
|
10
10
|
const DEFAULT_IGNORED_DEPENDENCIES = exports.DEFAULT_IGNORED_DEPENDENCIES = ["path-browserify", "qx-util"];
|
package/dist/index.cjs
CHANGED
|
@@ -36,17 +36,6 @@ Object.keys(_prettier).forEach(function (key) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
|
-
var _rollup = require("./rollup/index.cjs");
|
|
40
|
-
Object.keys(_rollup).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _rollup[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _rollup[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
39
|
var _stylelint = require("./stylelint/index.cjs");
|
|
51
40
|
Object.keys(_stylelint).forEach(function (key) {
|
|
52
41
|
if (key === "default" || key === "__esModule") return;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ var _vite = require("vite");
|
|
|
8
8
|
var _pluginVue = _interopRequireDefault(require("@vitejs/plugin-vue"));
|
|
9
9
|
var _pluginVueJsx = _interopRequireDefault(require("@vitejs/plugin-vue-jsx"));
|
|
10
10
|
var _vite2 = _interopRequireDefault(require("unocss/vite"));
|
|
11
|
-
var _viteTsconfigPaths = _interopRequireDefault(require("vite-tsconfig-paths"));
|
|
12
11
|
var _path = _interopRequireDefault(require("path"));
|
|
13
12
|
var _constants = require("../../constants/index.cjs");
|
|
14
13
|
var _util = require("../../util/index.cjs");
|
|
@@ -30,29 +29,8 @@ function defineViteBaseConfig(opts = {}) {
|
|
|
30
29
|
external: _constants.DEFAULT_EXTERNAL
|
|
31
30
|
}
|
|
32
31
|
},
|
|
33
|
-
plugins: [(0,
|
|
32
|
+
plugins: [(0, _pluginVue.default)(), (0, _pluginVueJsx.default)(), (0, _vite2.default)({
|
|
34
33
|
hmrTopLevelAwait: false
|
|
35
|
-
})
|
|
36
|
-
// 关系 babel 配置,这个配置要放在具体的 project vite 编译配置中,底包应该是干净的
|
|
37
|
-
// babel({
|
|
38
|
-
// babelHelpers: 'bundled',
|
|
39
|
-
// presets: [
|
|
40
|
-
// [
|
|
41
|
-
// '@babel/preset-env',
|
|
42
|
-
// {
|
|
43
|
-
// useBuiltIns: false,
|
|
44
|
-
// corejs: 3,
|
|
45
|
-
// bugfixes: true,
|
|
46
|
-
// targets: {
|
|
47
|
-
// chrome: '85',
|
|
48
|
-
// edge: '85',
|
|
49
|
-
// firefox: '79',
|
|
50
|
-
// safari: '14.1',
|
|
51
|
-
// },
|
|
52
|
-
// },
|
|
53
|
-
// ],
|
|
54
|
-
// ],
|
|
55
|
-
// }),
|
|
56
|
-
]
|
|
34
|
+
})]
|
|
57
35
|
}), opts);
|
|
58
36
|
}
|
|
@@ -17,27 +17,11 @@ function defineViteConfig(opts = {}) {
|
|
|
17
17
|
rf.sync(outDir);
|
|
18
18
|
return (0, _vite.mergeConfig)((0, _viteBaseConfig.defineViteBaseConfig)((0, _vite.defineConfig)({
|
|
19
19
|
build: {
|
|
20
|
-
rollupOptions: {
|
|
21
|
-
output: {
|
|
22
|
-
exports: "named"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
20
|
lib: {
|
|
26
21
|
entry: _path.default.resolve(cwd, "src/index.ts"),
|
|
27
|
-
formats: ["
|
|
22
|
+
formats: ["es"],
|
|
28
23
|
cssFileName: "index.min",
|
|
29
|
-
fileName
|
|
30
|
-
if (format === "system" || format === "systemjs") {
|
|
31
|
-
return `[name].system.min.js`;
|
|
32
|
-
}
|
|
33
|
-
if (format === "cjs" || format === "commonjs") {
|
|
34
|
-
return `[name].min.cjs`;
|
|
35
|
-
}
|
|
36
|
-
if (format === "es" || format === "esm" || format === "module") {
|
|
37
|
-
return `[name].esm.min.mjs`;
|
|
38
|
-
}
|
|
39
|
-
return `[name].${format}.min.js`;
|
|
40
|
-
}
|
|
24
|
+
fileName: "[name].[format].min"
|
|
41
25
|
}
|
|
42
26
|
}
|
|
43
27
|
})), opts);
|
|
@@ -7,7 +7,6 @@ exports.defineDevViteConfig = defineDevViteConfig;
|
|
|
7
7
|
var _vite = require("vite");
|
|
8
8
|
var _pluginVue = _interopRequireDefault(require("@vitejs/plugin-vue"));
|
|
9
9
|
var _pluginVueJsx = _interopRequireDefault(require("@vitejs/plugin-vue-jsx"));
|
|
10
|
-
var _pluginJson = _interopRequireDefault(require("@rollup/plugin-json"));
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
function defineDevViteConfig(opts = {}) {
|
|
13
12
|
return (0, _vite.mergeConfig)((0, _vite.defineConfig)({
|
|
@@ -18,6 +17,6 @@ function defineDevViteConfig(opts = {}) {
|
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
},
|
|
21
|
-
plugins: [(0,
|
|
20
|
+
plugins: [(0, _pluginVue.default)(), (0, _pluginVueJsx.default)()]
|
|
22
21
|
}), opts);
|
|
23
22
|
}
|
|
@@ -10,11 +10,9 @@ var rf = _interopRequireWildcard(require("rimraf"));
|
|
|
10
10
|
var _pluginVue = _interopRequireDefault(require("@vitejs/plugin-vue"));
|
|
11
11
|
var _pluginVueJsx = _interopRequireDefault(require("@vitejs/plugin-vue-jsx"));
|
|
12
12
|
var _vitePluginLibInjectCss = require("vite-plugin-lib-inject-css");
|
|
13
|
-
var _viteTsconfigPaths = _interopRequireDefault(require("vite-tsconfig-paths"));
|
|
14
13
|
var _vitePluginStaticCopy = require("vite-plugin-static-copy");
|
|
15
14
|
var _vitePluginDts = _interopRequireDefault(require("vite-plugin-dts"));
|
|
16
15
|
var _fs = require("fs");
|
|
17
|
-
var _vite2 = _interopRequireDefault(require("unocss/vite"));
|
|
18
16
|
var _util = require("../../util/index.cjs");
|
|
19
17
|
var _constants = require("../../constants/index.cjs");
|
|
20
18
|
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); }
|
|
@@ -46,7 +44,7 @@ function definePkgDevViteConfig(opts = {}) {
|
|
|
46
44
|
target: "esnext",
|
|
47
45
|
minify: false,
|
|
48
46
|
sourcemap: isDev,
|
|
49
|
-
|
|
47
|
+
rolldownOptions: {
|
|
50
48
|
external: id => {
|
|
51
49
|
if (pkgDependencies.some(dep => id === dep || id.startsWith(dep + "/"))) {
|
|
52
50
|
return true;
|
|
@@ -73,9 +71,9 @@ function definePkgDevViteConfig(opts = {}) {
|
|
|
73
71
|
formats: ["es"]
|
|
74
72
|
}
|
|
75
73
|
},
|
|
76
|
-
plugins: [(0,
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
plugins: [(0, _pluginVue.default)(), (0, _pluginVueJsx.default)(),
|
|
75
|
+
// UnoCSS({ hmrTopLevelAwait: false }) as PluginOption,
|
|
76
|
+
(0, _vitePluginLibInjectCss.libInjectCss)(), (0, _vitePluginDts.default)({
|
|
79
77
|
outDir: [outDir],
|
|
80
78
|
compilerOptions: {
|
|
81
79
|
declarationMap: isDev
|
|
@@ -7,44 +7,15 @@ exports.defineProjectViteConfig = defineProjectViteConfig;
|
|
|
7
7
|
var _vite = require("vite");
|
|
8
8
|
var _pluginVue = _interopRequireDefault(require("@vitejs/plugin-vue"));
|
|
9
9
|
var _pluginVueJsx = _interopRequireDefault(require("@vitejs/plugin-vue-jsx"));
|
|
10
|
-
var _pluginLegacy = _interopRequireDefault(require("@vitejs/plugin-legacy"));
|
|
11
10
|
var _vite2 = _interopRequireDefault(require("unocss/vite"));
|
|
12
11
|
var _path = _interopRequireDefault(require("path"));
|
|
13
12
|
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
14
|
-
var _simpleGit = require("simple-git");
|
|
15
13
|
var _util = require("../../util/index.cjs");
|
|
16
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
|
|
18
|
-
httpProxyConfig: {
|
|
19
|
-
alpha: "http://paas.alpha.gct-paas.com",
|
|
20
|
-
beta: "http://paas.beta.gct-paas.com",
|
|
21
|
-
"paas-ai-dev": "http://paas.aidev.gct-paas.com",
|
|
22
|
-
"paas-dev": "http://paas.paasdev.gct-paas.com",
|
|
23
|
-
"paas-test": "http://paas.paastest.gct-paas.com",
|
|
24
|
-
"mom-dev": "http://paas.momdev.gct-paas.com",
|
|
25
|
-
"mom-test": "http://paas.momtest.gct-paas.com",
|
|
26
|
-
"ncdp-dev": "http://paas.ncdpdev.gct-paas.com",
|
|
27
|
-
"ncdp-test": "http://paas.ncdptest.gct-paas.com",
|
|
28
|
-
"ipaas-dev": "http://paas.ipaasdev.gct-paas.com",
|
|
29
|
-
"ipaas-test": "http://paas.ipaastest.gct-paas.com",
|
|
30
|
-
"edhr-dev": "http://paas.edhrdev.gct-paas.com",
|
|
31
|
-
"edhr-test": "http://paas.edhrtest.gct-paas.com",
|
|
32
|
-
"datav-dev": "http://paas.datavdev.gct-paas.com"
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
36
|
-
const _gctOpts = (0, _util.mergeConfig)(gctOptsDefault, gctOpts);
|
|
15
|
+
function defineProjectViteConfig(opts = {}) {
|
|
37
16
|
return (0, _vite.defineConfig)(async () => {
|
|
38
17
|
const cwd = process.cwd();
|
|
39
18
|
const pkg = _fsExtra.default.readJsonSync(_path.default.resolve(cwd, "package.json"));
|
|
40
|
-
const git = (0, _simpleGit.simpleGit)({
|
|
41
|
-
baseDir: cwd
|
|
42
|
-
});
|
|
43
|
-
const branchSummary = await git.branch();
|
|
44
|
-
const httpProxyKey = Object.keys(_gctOpts.httpProxyConfig).find(key => {
|
|
45
|
-
return key.startsWith(branchSummary.current);
|
|
46
|
-
}) || "paas-test";
|
|
47
|
-
const httpProxy = _gctOpts.httpProxyConfig[httpProxyKey];
|
|
48
19
|
return (0, _util.mergeConfig)({
|
|
49
20
|
base: "./",
|
|
50
21
|
resolve: {
|
|
@@ -54,7 +25,7 @@ function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
|
54
25
|
},
|
|
55
26
|
build: {
|
|
56
27
|
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/
|
|
28
|
+
external: ["axios", "dayjs", "pinia", "lodash-es", "vue", "vue-i18n", "vue-router", "ant-design-vue", "pinia", "systemjs", "@gct-paas/api", "@gct-paas/core", "@gct-paas/core-mobile", "@gct-paas/core-web", "@gct-paas/core-pad", "@gct-paas/design", "@gct-paas/design-mobile", "@gct-paas/design-web", "@gct-paas/design-pad", "@gct-paas/render", "@gct-paas/render-mobile", "@gct-paas/render-pad", "@gct-paas/render-web", "@gct-paas/schema", "@gct-paas/scss", "@gct-paas/formula-editor", "@gct-paas/platform-icons"]
|
|
58
29
|
}
|
|
59
30
|
},
|
|
60
31
|
css: {
|
|
@@ -72,11 +43,7 @@ function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
|
72
43
|
strict: false
|
|
73
44
|
},
|
|
74
45
|
proxy: {
|
|
75
|
-
hostname: "0.0.0.0"
|
|
76
|
-
...["/gct-platform", "/gct-apaas", "/gct-ipaas", "/minio"].reduce((acc, item) => {
|
|
77
|
-
acc[item] = httpProxy;
|
|
78
|
-
return acc;
|
|
79
|
-
}, {})
|
|
46
|
+
hostname: "0.0.0.0"
|
|
80
47
|
}
|
|
81
48
|
},
|
|
82
49
|
define: {
|
|
@@ -87,11 +54,6 @@ function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
|
87
54
|
},
|
|
88
55
|
plugins: [(0, _pluginVue.default)(), (0, _pluginVueJsx.default)(), (0, _vite2.default)({
|
|
89
56
|
hmrTopLevelAwait: false
|
|
90
|
-
}), (0, _pluginLegacy.default)({
|
|
91
|
-
targets: ["chrome>=85", "edge>=85", "firefox>=79", "safari>=14.1"],
|
|
92
|
-
externalSystemJS: true,
|
|
93
|
-
// 关键配置:false 时只生成 legacy 版本
|
|
94
|
-
renderModernChunks: true
|
|
95
57
|
})]
|
|
96
58
|
}, opts);
|
|
97
59
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UserConfig, UserConfigFnPromise } from 'vite';
|
|
2
|
-
import { GctOpts } from '../gct-opts.interface';
|
|
3
2
|
/**
|
|
4
3
|
* 构建本地开发 project 项目 vite 通用配置,基于此配置构建其他 vite 配置
|
|
5
4
|
* 参数合并时,数组会被合并而不是被替换
|
|
@@ -10,4 +9,4 @@ import { GctOpts } from '../gct-opts.interface';
|
|
|
10
9
|
* @param {UserConfig} [opts={}]
|
|
11
10
|
* @returns {*} {Promise<UserConfig>}
|
|
12
11
|
*/
|
|
13
|
-
export declare function defineProjectViteConfig(
|
|
12
|
+
export declare function defineProjectViteConfig(opts?: UserConfig): UserConfigFnPromise;
|
package/es/constants/index.mjs
CHANGED
|
@@ -14,6 +14,12 @@ export const DEFAULT_EXTERNAL = [
|
|
|
14
14
|
"vue-grid-layout",
|
|
15
15
|
"vant",
|
|
16
16
|
"ant-design-vue",
|
|
17
|
+
"@ant-design/icons-vue",
|
|
18
|
+
"@icon-park/vue-next/es/all",
|
|
19
|
+
"@icon-park/vue-next/icons.json",
|
|
20
|
+
"bignumber.js",
|
|
21
|
+
"wujie",
|
|
22
|
+
"sql-formatter",
|
|
17
23
|
"@gct-paas/build",
|
|
18
24
|
"@gct-paas/api",
|
|
19
25
|
"@gct-paas/core",
|
|
@@ -24,10 +30,14 @@ export const DEFAULT_EXTERNAL = [
|
|
|
24
30
|
"@gct-paas/design-mobile",
|
|
25
31
|
"@gct-paas/design-web",
|
|
26
32
|
"@gct-paas/design-pad",
|
|
27
|
-
"@gct-paas/
|
|
33
|
+
"@gct-paas/render",
|
|
34
|
+
"@gct-paas/render-mobile",
|
|
35
|
+
"@gct-paas/render-pad",
|
|
36
|
+
"@gct-paas/render-web",
|
|
37
|
+
"@gct-paas/schema",
|
|
28
38
|
"@gct-paas/scss",
|
|
29
|
-
"@gct-paas/
|
|
30
|
-
"@gct-paas/
|
|
39
|
+
"@gct-paas/formula-editor",
|
|
40
|
+
"@gct-paas/platform-icons",
|
|
31
41
|
"systemjs"
|
|
32
42
|
];
|
|
33
43
|
export const DEFAULT_IGNORED_DEPENDENCIES = ["path-browserify", "qx-util"];
|
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./commitlint/index.mjs";
|
|
2
2
|
export * from "./eslint/index.mjs";
|
|
3
3
|
export * from "./prettier/index.mjs";
|
|
4
|
-
export * from "./rollup/index.mjs";
|
|
5
4
|
export * from "./stylelint/index.mjs";
|
|
6
5
|
export * from "./unocss/index.mjs";
|
|
7
6
|
export * from "./util/index.mjs";
|
|
@@ -2,7 +2,6 @@ import { defineConfig } from "vite";
|
|
|
2
2
|
import vue from "@vitejs/plugin-vue";
|
|
3
3
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
4
4
|
import UnoCSS from "unocss/vite";
|
|
5
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
6
5
|
import path from "path";
|
|
7
6
|
import { DEFAULT_EXTERNAL } from "../../constants/index.mjs";
|
|
8
7
|
import { mergeConfig } from "../../util/index.mjs";
|
|
@@ -25,30 +24,9 @@ export function defineViteBaseConfig(opts = {}) {
|
|
|
25
24
|
}
|
|
26
25
|
},
|
|
27
26
|
plugins: [
|
|
28
|
-
tsconfigPaths(),
|
|
29
27
|
vue(),
|
|
30
28
|
vueJsx(),
|
|
31
29
|
UnoCSS({ hmrTopLevelAwait: false })
|
|
32
|
-
// 关系 babel 配置,这个配置要放在具体的 project vite 编译配置中,底包应该是干净的
|
|
33
|
-
// babel({
|
|
34
|
-
// babelHelpers: 'bundled',
|
|
35
|
-
// presets: [
|
|
36
|
-
// [
|
|
37
|
-
// '@babel/preset-env',
|
|
38
|
-
// {
|
|
39
|
-
// useBuiltIns: false,
|
|
40
|
-
// corejs: 3,
|
|
41
|
-
// bugfixes: true,
|
|
42
|
-
// targets: {
|
|
43
|
-
// chrome: '85',
|
|
44
|
-
// edge: '85',
|
|
45
|
-
// firefox: '79',
|
|
46
|
-
// safari: '14.1',
|
|
47
|
-
// },
|
|
48
|
-
// },
|
|
49
|
-
// ],
|
|
50
|
-
// ],
|
|
51
|
-
// }),
|
|
52
30
|
]
|
|
53
31
|
}),
|
|
54
32
|
opts
|
|
@@ -10,27 +10,11 @@ export function defineViteConfig(opts = {}) {
|
|
|
10
10
|
defineViteBaseConfig(
|
|
11
11
|
defineConfig({
|
|
12
12
|
build: {
|
|
13
|
-
rollupOptions: {
|
|
14
|
-
output: {
|
|
15
|
-
exports: "named"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
13
|
lib: {
|
|
19
14
|
entry: path.resolve(cwd, "src/index.ts"),
|
|
20
|
-
formats: ["
|
|
15
|
+
formats: ["es"],
|
|
21
16
|
cssFileName: "index.min",
|
|
22
|
-
fileName
|
|
23
|
-
if (format === "system" || format === "systemjs") {
|
|
24
|
-
return `[name].system.min.js`;
|
|
25
|
-
}
|
|
26
|
-
if (format === "cjs" || format === "commonjs") {
|
|
27
|
-
return `[name].min.cjs`;
|
|
28
|
-
}
|
|
29
|
-
if (format === "es" || format === "esm" || format === "module") {
|
|
30
|
-
return `[name].esm.min.mjs`;
|
|
31
|
-
}
|
|
32
|
-
return `[name].${format}.min.js`;
|
|
33
|
-
}
|
|
17
|
+
fileName: "[name].[format].min"
|
|
34
18
|
}
|
|
35
19
|
}
|
|
36
20
|
})
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineConfig, mergeConfig } from "vite";
|
|
2
2
|
import vue from "@vitejs/plugin-vue";
|
|
3
3
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
4
|
-
import json from "@rollup/plugin-json";
|
|
5
4
|
export function defineDevViteConfig(opts = {}) {
|
|
6
5
|
return mergeConfig(
|
|
7
6
|
defineConfig({
|
|
@@ -12,7 +11,7 @@ export function defineDevViteConfig(opts = {}) {
|
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
13
|
},
|
|
15
|
-
plugins: [
|
|
14
|
+
plugins: [vue(), vueJsx()]
|
|
16
15
|
}),
|
|
17
16
|
opts
|
|
18
17
|
);
|
|
@@ -4,11 +4,9 @@ import * as rf from "rimraf";
|
|
|
4
4
|
import vue from "@vitejs/plugin-vue";
|
|
5
5
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
6
6
|
import { libInjectCss } from "vite-plugin-lib-inject-css";
|
|
7
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
8
7
|
import { viteStaticCopy } from "vite-plugin-static-copy";
|
|
9
8
|
import dts from "vite-plugin-dts";
|
|
10
9
|
import { readFileSync } from "fs";
|
|
11
|
-
import UnoCSS from "unocss/vite";
|
|
12
10
|
import { mergeConfig, IS_NODE_MODULE } from "../../util/index.mjs";
|
|
13
11
|
import { DEFAULT_EXTERNAL } from "../../constants/index.mjs";
|
|
14
12
|
export function definePkgDevViteConfig(opts = {}) {
|
|
@@ -38,7 +36,7 @@ export function definePkgDevViteConfig(opts = {}) {
|
|
|
38
36
|
target: "esnext",
|
|
39
37
|
minify: false,
|
|
40
38
|
sourcemap: isDev,
|
|
41
|
-
|
|
39
|
+
rolldownOptions: {
|
|
42
40
|
external: (id) => {
|
|
43
41
|
if (pkgDependencies.some(
|
|
44
42
|
(dep) => id === dep || id.startsWith(dep + "/")
|
|
@@ -66,10 +64,9 @@ export function definePkgDevViteConfig(opts = {}) {
|
|
|
66
64
|
}
|
|
67
65
|
},
|
|
68
66
|
plugins: [
|
|
69
|
-
tsconfigPaths(),
|
|
70
67
|
vue(),
|
|
71
68
|
vueJsx(),
|
|
72
|
-
UnoCSS({ hmrTopLevelAwait: false }),
|
|
69
|
+
// UnoCSS({ hmrTopLevelAwait: false }) as PluginOption,
|
|
73
70
|
libInjectCss(),
|
|
74
71
|
dts({
|
|
75
72
|
outDir: [outDir],
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UserConfig, UserConfigFnPromise } from 'vite';
|
|
2
|
-
import { GctOpts } from '../gct-opts.interface';
|
|
3
2
|
/**
|
|
4
3
|
* 构建本地开发 project 项目 vite 通用配置,基于此配置构建其他 vite 配置
|
|
5
4
|
* 参数合并时,数组会被合并而不是被替换
|
|
@@ -10,4 +9,4 @@ import { GctOpts } from '../gct-opts.interface';
|
|
|
10
9
|
* @param {UserConfig} [opts={}]
|
|
11
10
|
* @returns {*} {Promise<UserConfig>}
|
|
12
11
|
*/
|
|
13
|
-
export declare function defineProjectViteConfig(
|
|
12
|
+
export declare function defineProjectViteConfig(opts?: UserConfig): UserConfigFnPromise;
|
|
@@ -3,41 +3,14 @@ import {
|
|
|
3
3
|
} from "vite";
|
|
4
4
|
import vue from "@vitejs/plugin-vue";
|
|
5
5
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
6
|
-
import legacy from "@vitejs/plugin-legacy";
|
|
7
6
|
import UnoCSS from "unocss/vite";
|
|
8
7
|
import path from "path";
|
|
9
8
|
import fse from "fs-extra";
|
|
10
|
-
import { simpleGit } from "simple-git";
|
|
11
9
|
import { mergeConfig } from "../../util/index.mjs";
|
|
12
|
-
|
|
13
|
-
httpProxyConfig: {
|
|
14
|
-
alpha: "http://paas.alpha.gct-paas.com",
|
|
15
|
-
beta: "http://paas.beta.gct-paas.com",
|
|
16
|
-
"paas-ai-dev": "http://paas.aidev.gct-paas.com",
|
|
17
|
-
"paas-dev": "http://paas.paasdev.gct-paas.com",
|
|
18
|
-
"paas-test": "http://paas.paastest.gct-paas.com",
|
|
19
|
-
"mom-dev": "http://paas.momdev.gct-paas.com",
|
|
20
|
-
"mom-test": "http://paas.momtest.gct-paas.com",
|
|
21
|
-
"ncdp-dev": "http://paas.ncdpdev.gct-paas.com",
|
|
22
|
-
"ncdp-test": "http://paas.ncdptest.gct-paas.com",
|
|
23
|
-
"ipaas-dev": "http://paas.ipaasdev.gct-paas.com",
|
|
24
|
-
"ipaas-test": "http://paas.ipaastest.gct-paas.com",
|
|
25
|
-
"edhr-dev": "http://paas.edhrdev.gct-paas.com",
|
|
26
|
-
"edhr-test": "http://paas.edhrtest.gct-paas.com",
|
|
27
|
-
"datav-dev": "http://paas.datavdev.gct-paas.com"
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
31
|
-
const _gctOpts = mergeConfig(gctOptsDefault, gctOpts);
|
|
10
|
+
export function defineProjectViteConfig(opts = {}) {
|
|
32
11
|
return defineConfig(async () => {
|
|
33
12
|
const cwd = process.cwd();
|
|
34
13
|
const pkg = fse.readJsonSync(path.resolve(cwd, "package.json"));
|
|
35
|
-
const git = simpleGit({ baseDir: cwd });
|
|
36
|
-
const branchSummary = await git.branch();
|
|
37
|
-
const httpProxyKey = Object.keys(_gctOpts.httpProxyConfig).find((key) => {
|
|
38
|
-
return key.startsWith(branchSummary.current);
|
|
39
|
-
}) || "paas-test";
|
|
40
|
-
const httpProxy = _gctOpts.httpProxyConfig[httpProxyKey];
|
|
41
14
|
return mergeConfig(
|
|
42
15
|
{
|
|
43
16
|
base: "./",
|
|
@@ -59,11 +32,23 @@ export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
|
59
32
|
"ant-design-vue",
|
|
60
33
|
"pinia",
|
|
61
34
|
"systemjs",
|
|
35
|
+
"@gct-paas/api",
|
|
62
36
|
"@gct-paas/core",
|
|
37
|
+
"@gct-paas/core-mobile",
|
|
63
38
|
"@gct-paas/core-web",
|
|
64
|
-
"@gct-paas/
|
|
65
|
-
"@gct-paas/
|
|
66
|
-
"@gct-paas/
|
|
39
|
+
"@gct-paas/core-pad",
|
|
40
|
+
"@gct-paas/design",
|
|
41
|
+
"@gct-paas/design-mobile",
|
|
42
|
+
"@gct-paas/design-web",
|
|
43
|
+
"@gct-paas/design-pad",
|
|
44
|
+
"@gct-paas/render",
|
|
45
|
+
"@gct-paas/render-mobile",
|
|
46
|
+
"@gct-paas/render-pad",
|
|
47
|
+
"@gct-paas/render-web",
|
|
48
|
+
"@gct-paas/schema",
|
|
49
|
+
"@gct-paas/scss",
|
|
50
|
+
"@gct-paas/formula-editor",
|
|
51
|
+
"@gct-paas/platform-icons"
|
|
67
52
|
]
|
|
68
53
|
}
|
|
69
54
|
},
|
|
@@ -82,14 +67,7 @@ export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
|
82
67
|
strict: false
|
|
83
68
|
},
|
|
84
69
|
proxy: {
|
|
85
|
-
hostname: "0.0.0.0"
|
|
86
|
-
...["/gct-platform", "/gct-apaas", "/gct-ipaas", "/minio"].reduce(
|
|
87
|
-
(acc, item) => {
|
|
88
|
-
acc[item] = httpProxy;
|
|
89
|
-
return acc;
|
|
90
|
-
},
|
|
91
|
-
{}
|
|
92
|
-
)
|
|
70
|
+
hostname: "0.0.0.0"
|
|
93
71
|
}
|
|
94
72
|
},
|
|
95
73
|
define: {
|
|
@@ -101,13 +79,7 @@ export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
|
|
|
101
79
|
plugins: [
|
|
102
80
|
vue(),
|
|
103
81
|
vueJsx(),
|
|
104
|
-
UnoCSS({ hmrTopLevelAwait: false })
|
|
105
|
-
legacy({
|
|
106
|
-
targets: ["chrome>=85", "edge>=85", "firefox>=79", "safari>=14.1"],
|
|
107
|
-
externalSystemJS: true,
|
|
108
|
-
// 关键配置:false 时只生成 legacy 版本
|
|
109
|
-
renderModernChunks: true
|
|
110
|
-
})
|
|
82
|
+
UnoCSS({ hmrTopLevelAwait: false })
|
|
111
83
|
]
|
|
112
84
|
},
|
|
113
85
|
opts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/build",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-dev.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -39,34 +39,23 @@
|
|
|
39
39
|
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@eslint/config-helpers": "^0.5.2",
|
|
47
|
-
"@eslint/js": "^9.39.3",
|
|
42
|
+
"@commitlint/cli": "^20.4.4",
|
|
43
|
+
"@commitlint/config-conventional": "^20.4.4",
|
|
44
|
+
"@eslint/config-helpers": "^0.5.3",
|
|
45
|
+
"@eslint/js": "^10.0.1",
|
|
48
46
|
"@gct-paas/scss": "^0.1.5",
|
|
49
47
|
"@inquirer/prompts": "^8.3.0",
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
54
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
55
|
-
"@rollup/plugin-typescript": "^12.3.0",
|
|
56
|
-
"@vitejs/plugin-legacy": "^7.2.1",
|
|
57
|
-
"@vitejs/plugin-vue": "^6.0.4",
|
|
58
|
-
"@vitejs/plugin-vue-jsx": "^5.1.4",
|
|
59
|
-
"@vue/compiler-sfc": "^3.5.29",
|
|
48
|
+
"@vitejs/plugin-vue": "^6.0.5",
|
|
49
|
+
"@vitejs/plugin-vue-jsx": "^5.1.5",
|
|
50
|
+
"@vue/compiler-sfc": "^3.5.30",
|
|
60
51
|
"chokidar": "^5.0.0",
|
|
61
52
|
"commander": "^14.0.3",
|
|
62
53
|
"consola": "^3.4.2",
|
|
63
54
|
"copy-file": "^11.1.0",
|
|
64
55
|
"core-js": "^3.48.0",
|
|
65
|
-
"cpy": "^12.1.0",
|
|
66
56
|
"crypto": "^1.0.1",
|
|
67
|
-
"cssnano": "^7.1.
|
|
68
|
-
"
|
|
69
|
-
"eslint": "^9.39.3",
|
|
57
|
+
"cssnano": "^7.1.3",
|
|
58
|
+
"eslint": "^9.39.4",
|
|
70
59
|
"eslint-config-prettier": "^10.1.8",
|
|
71
60
|
"eslint-plugin-import": "^2.32.0",
|
|
72
61
|
"eslint-plugin-prettier": "^5.5.5",
|
|
@@ -80,33 +69,29 @@
|
|
|
80
69
|
"picocolors": "^1.1.1",
|
|
81
70
|
"prettier": "^3.8.1",
|
|
82
71
|
"rimraf": "^6.1.3",
|
|
83
|
-
"
|
|
84
|
-
"rollup-plugin-esbuild": "^6.2.1",
|
|
85
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
86
|
-
"sass": "^1.97.3",
|
|
87
|
-
"simple-git": "^3.32.3",
|
|
72
|
+
"sass": "^1.98.0",
|
|
88
73
|
"stylelint": "^17.4.0",
|
|
89
74
|
"stylelint-config-standard-scss": "^17.0.0",
|
|
90
|
-
"typescript-eslint": "^8.
|
|
91
|
-
"unocss": "66.6.
|
|
92
|
-
"vite": "^
|
|
75
|
+
"typescript-eslint": "^8.57.0",
|
|
76
|
+
"unocss": "66.6.6",
|
|
77
|
+
"vite": "^8.0.0",
|
|
93
78
|
"vite-plugin-dts": "^4.5.4",
|
|
94
79
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
95
|
-
"vite-plugin-static-copy": "^3.
|
|
96
|
-
"vite-tsconfig-paths": "^6.1.1",
|
|
80
|
+
"vite-plugin-static-copy": "^3.3.0",
|
|
97
81
|
"vue-eslint-parser": "^10.4.0",
|
|
98
82
|
"vue-tsc": "^3.2.5"
|
|
99
83
|
},
|
|
100
84
|
"devDependencies": {
|
|
101
|
-
"@commitlint/types": "^20.4.
|
|
85
|
+
"@commitlint/types": "^20.4.4",
|
|
102
86
|
"@types/babel__core": "^7.20.5",
|
|
103
87
|
"@types/babel__preset-env": "^7.10.0",
|
|
104
88
|
"@types/fs-extra": "^11.0.4",
|
|
105
89
|
"@types/lodash-es": "^4.17.12",
|
|
106
|
-
"@types/node": "^25.
|
|
90
|
+
"@types/node": "^25.5.0",
|
|
107
91
|
"postcss": "^8.5.8",
|
|
108
92
|
"tsx": "^4.21.0",
|
|
109
93
|
"typescript": "^5.9.3",
|
|
110
94
|
"unbuild": "^3.6.1"
|
|
111
|
-
}
|
|
95
|
+
},
|
|
96
|
+
"gitHead": "ac6a576b84157817fa6d5159bb0725ba189aa11e"
|
|
112
97
|
}
|