@gct-paas/build 0.1.4-dev.5 → 0.1.4-dev.7

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.
@@ -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"];
@@ -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) {
@@ -1,2 +1,3 @@
1
+ export { defineRollupBuildConfig } from './rollup-config/build-config';
1
2
  export { defineRollupConfig } from './rollup-config/dev-config';
2
3
  export * from './rollup-plugins';
@@ -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
+ }
@@ -0,0 +1,9 @@
1
+ import { RollupOptions } from 'rollup';
2
+ /**
3
+ * 开发包基础编译配置
4
+ *
5
+ * @export
6
+ * @param {RollupOptions} [opts={}]
7
+ * @returns {*} {RollupOptions}
8
+ */
9
+ export declare function defineRollupBuildConfig(opts?: RollupOptions): RollupOptions;
@@ -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
  }
@@ -7,7 +7,6 @@ exports.defineViteBaseConfig = defineViteBaseConfig;
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 _pluginBabel = require("@rollup/plugin-babel");
11
10
  var _pluginJson = _interopRequireDefault(require("@rollup/plugin-json"));
12
11
  var _path = _interopRequireDefault(require("path"));
13
12
  var _constants = require("../../constants/index.cjs");
@@ -30,19 +29,27 @@ function defineViteBaseConfig(opts = {}) {
30
29
  external: _constants.DEFAULT_EXTERNAL
31
30
  }
32
31
  },
33
- plugins: [(0, _pluginJson.default)(), (0, _pluginVue.default)(), (0, _pluginVueJsx.default)(), (0, _pluginBabel.babel)({
34
- babelHelpers: "bundled",
35
- presets: [["@babel/preset-env", {
36
- useBuiltIns: "usage",
37
- corejs: 3,
38
- bugfixes: true,
39
- targets: {
40
- chrome: "85",
41
- edge: "85",
42
- firefox: "79",
43
- safari: "14.1"
44
- }
45
- }]]
46
- })]
32
+ plugins: [(0, _pluginJson.default)(), (0, _pluginVue.default)(), (0, _pluginVueJsx.default)()
33
+ // 关系 babel 配置,这个配置要放在具体的 project vite 编译配置中,底包应该是干净的
34
+ // babel({
35
+ // babelHelpers: 'bundled',
36
+ // presets: [
37
+ // [
38
+ // '@babel/preset-env',
39
+ // {
40
+ // useBuiltIns: false,
41
+ // corejs: 3,
42
+ // bugfixes: true,
43
+ // targets: {
44
+ // chrome: '85',
45
+ // edge: '85',
46
+ // firefox: '79',
47
+ // safari: '14.1',
48
+ // },
49
+ // },
50
+ // ],
51
+ // ],
52
+ // }),
53
+ ]
47
54
  }), opts);
48
55
  }
@@ -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) {
@@ -46,6 +46,7 @@ function defineProjectViteConfig(gctOpts = {}, opts = {}) {
46
46
  }) || "paas-dev";
47
47
  const httpProxy = _gctOpts.httpProxyConfig[httpProxyKey];
48
48
  return (0, _util.mergeConfig)({
49
+ base: "./",
49
50
  resolve: {
50
51
  alias: {
51
52
  "@": _path.default.resolve(cwd, "src")
@@ -53,7 +54,7 @@ function defineProjectViteConfig(gctOpts = {}, opts = {}) {
53
54
  },
54
55
  build: {
55
56
  rollupOptions: {
56
- external: ["core-js", "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"]
57
58
  }
58
59
  },
59
60
  css: {
@@ -86,8 +87,8 @@ function defineProjectViteConfig(gctOpts = {}, opts = {}) {
86
87
  plugins: [(0, _pluginJson.default)(), (0, _pluginVue.default)(), (0, _pluginVueJsx.default)(), (0, _pluginLegacy.default)({
87
88
  targets: ["chrome>=85", "edge>=85", "firefox>=79", "safari>=14.1"],
88
89
  externalSystemJS: true,
89
- // 关键配置:只生成 legacy 版本
90
- renderModernChunks: false
90
+ // 关键配置:false 时只生成 legacy 版本
91
+ renderModernChunks: true
91
92
  })]
92
93
  }, opts);
93
94
  });
@@ -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",
@@ -1,2 +1,3 @@
1
+ export { defineRollupBuildConfig } from './rollup-config/build-config';
1
2
  export { defineRollupConfig } from './rollup-config/dev-config';
2
3
  export * from './rollup-plugins';
@@ -1,2 +1,3 @@
1
+ export { defineRollupBuildConfig } from "./rollup-config/build-config.mjs";
1
2
  export { defineRollupConfig } from "./rollup-config/dev-config.mjs";
2
3
  export * from "./rollup-plugins/index.mjs";
@@ -0,0 +1,9 @@
1
+ import { RollupOptions } from 'rollup';
2
+ /**
3
+ * 开发包基础编译配置
4
+ *
5
+ * @export
6
+ * @param {RollupOptions} [opts={}]
7
+ * @returns {*} {RollupOptions}
8
+ */
9
+ export declare function defineRollupBuildConfig(opts?: RollupOptions): RollupOptions;
@@ -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
@@ -1,7 +1,6 @@
1
1
  import { defineConfig } from "vite";
2
2
  import vue from "@vitejs/plugin-vue";
3
3
  import vueJsx from "@vitejs/plugin-vue-jsx";
4
- import { babel } from "@rollup/plugin-babel";
5
4
  import json from "@rollup/plugin-json";
6
5
  import path from "path";
7
6
  import { DEFAULT_EXTERNAL } from "../../constants/index.mjs";
@@ -27,26 +26,27 @@ export function defineViteBaseConfig(opts = {}) {
27
26
  plugins: [
28
27
  json(),
29
28
  vue(),
30
- vueJsx(),
31
- babel({
32
- babelHelpers: "bundled",
33
- presets: [
34
- [
35
- "@babel/preset-env",
36
- {
37
- useBuiltIns: "usage",
38
- corejs: 3,
39
- bugfixes: true,
40
- targets: {
41
- chrome: "85",
42
- edge: "85",
43
- firefox: "79",
44
- safari: "14.1"
45
- }
46
- }
47
- ]
48
- ]
49
- })
29
+ vueJsx()
30
+ // 关系 babel 配置,这个配置要放在具体的 project vite 编译配置中,底包应该是干净的
31
+ // babel({
32
+ // babelHelpers: 'bundled',
33
+ // presets: [
34
+ // [
35
+ // '@babel/preset-env',
36
+ // {
37
+ // useBuiltIns: false,
38
+ // corejs: 3,
39
+ // bugfixes: true,
40
+ // targets: {
41
+ // chrome: '85',
42
+ // edge: '85',
43
+ // firefox: '79',
44
+ // safari: '14.1',
45
+ // },
46
+ // },
47
+ // ],
48
+ // ],
49
+ // }),
50
50
  ]
51
51
  }),
52
52
  opts
@@ -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) {
@@ -40,6 +40,7 @@ export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
40
40
  const httpProxy = _gctOpts.httpProxyConfig[httpProxyKey];
41
41
  return mergeConfig(
42
42
  {
43
+ base: "./",
43
44
  resolve: {
44
45
  alias: {
45
46
  "@": path.resolve(cwd, "src")
@@ -48,7 +49,10 @@ export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
48
49
  build: {
49
50
  rollupOptions: {
50
51
  external: [
51
- "core-js",
52
+ "axios",
53
+ "dayjs",
54
+ "pinia",
55
+ "lodash-es",
52
56
  "vue",
53
57
  "vue-i18n",
54
58
  "vue-router",
@@ -57,7 +61,9 @@ export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
57
61
  "systemjs",
58
62
  "@gct-paas/core",
59
63
  "@gct-paas/core-web",
60
- "@gct-paas/api"
64
+ "@gct-paas/api/apaas",
65
+ "@gct-paas/api/ipaas",
66
+ "@gct-paas/api/platform"
61
67
  ]
62
68
  }
63
69
  },
@@ -98,8 +104,8 @@ export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
98
104
  legacy({
99
105
  targets: ["chrome>=85", "edge>=85", "firefox>=79", "safari>=14.1"],
100
106
  externalSystemJS: true,
101
- // 关键配置:只生成 legacy 版本
102
- renderModernChunks: false
107
+ // 关键配置:false 时只生成 legacy 版本
108
+ renderModernChunks: true
103
109
  })
104
110
  ]
105
111
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/build",
3
- "version": "0.1.4-dev.5",
3
+ "version": "0.1.4-dev.7",
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.3",
43
- "@babel/preset-env": "^7.28.3",
44
- "@commitlint/cli": "^19.8.1",
45
- "@commitlint/config-conventional": "^19.8.1",
46
- "@eslint/js": "^9.33.0",
47
- "@gct-paas/scss": "^0.1.4-dev.5",
48
- "@inquirer/prompts": "^7.8.3",
49
- "@rollup/plugin-babel": "^6.0.4",
50
- "@rollup/plugin-commonjs": "^28.0.6",
51
- "@rollup/plugin-eslint": "^9.0.5",
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.1",
54
- "@rollup/plugin-typescript": "^12.1.4",
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.1",
57
- "@vitejs/plugin-vue-jsx": "^5.0.1",
58
- "@vue/compiler-sfc": "^3.5.18",
59
- "chokidar": "^4.0.3",
60
- "commander": "^14.0.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.45.0",
64
- "cpy": "^12.0.1",
63
+ "core-js": "^3.48.0",
64
+ "cpy": "^12.1.0",
65
65
  "crypto": "^1.0.1",
66
- "esbuild": "^0.25.9",
67
- "eslint": "^9.33.0",
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.4",
71
- "eslint-plugin-unused-imports": "^4.2.0",
72
- "eslint-plugin-vue": "^10.4.0",
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.1",
75
- "globals": "^16.3.0",
76
- "lodash-es": "^4.17.21",
77
- "ora": "^8.2.0",
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.6.2",
80
- "rimraf": "^6.0.1",
81
- "rollup": "^4.46.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
- "simple-git": "^3.28.0",
84
- "stylelint": "^16.23.1",
85
- "stylelint-config-standard-scss": "^15.0.1",
86
- "typescript-eslint": "^8.40.0",
87
- "vite": "^7.1.3",
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.0.5"
93
+ "vue-tsc": "^3.2.3"
91
94
  },
92
95
  "devDependencies": {
93
- "@commitlint/types": "^19.8.1",
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": "^24.3.0",
99
- "tsx": "^4.20.4",
100
- "typescript": "^5.9.2",
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": "6fd4f6f4c3a0e1bd1fc4eea78fa9c2760e2219be"
107
+ "gitHead": "d5c70cf34961e0bd1736b97f04b4afdf06386d23"
104
108
  }