@gct-paas/build 0.1.7 → 0.1.9

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/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.9] - 2026-04-22
11
+
12
+ ### Added
13
+
14
+ - 优化平台套件和插件开发时的日志输出,避免一些特殊处理的异常报错
15
+
16
+ ## [0.1.8] - 2026-04-17
17
+
18
+ ### Added
19
+
20
+ - 新增外部依赖 pinyin-pro
21
+
10
22
  ## [0.1.7] - 2026-04-03
11
23
 
12
24
  ### Added
@@ -12,7 +12,7 @@ const DEFAULT_EXTERNAL = exports.DEFAULT_EXTERNAL = ["@babel/standalone", "espri
12
12
  // 第三方依赖
13
13
  "axios", "dayjs", "lodash-es", "qs", "bignumber.js", "wujie", "@module-federation/runtime", "sql-formatter", "mqtt", "@fingerprintjs/fingerprintjs", "overlayscrollbars", "@jsplumb/browser-ui", "sortablejs", "interactjs", "bwip-js",
14
14
  // 组件库相关依赖
15
- "vuedraggable", "vue-grid-layout", "vant", "ant-design-vue", "vxe-table",
15
+ "vuedraggable", "vue-grid-layout", "vant", "ant-design-vue", "vxe-table", "pinyin-pro",
16
16
  // 图标库相关依赖
17
17
  "@ant-design/icons-vue", "@icon-park/vue-next/es/all", "@icon-park/vue-next/icons.json",
18
18
  // @gct-paas 底包相关依赖
@@ -14,12 +14,28 @@ var _viteBaseConfig = require("./vite-base-config.cjs");
14
14
  var _constants = require("../../constants/index.cjs");
15
15
  var _imnportExternalPlugin = require("../vite-plugins/imnport-external-plugin.cjs");
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ const idReg = /(?<=resolved id: )[^)]+/;
18
+ const logger = (0, _vite.createLogger)();
19
+ const originalWarn = logger.error.bind(logger);
20
+ logger.error = (msg, opts) => {
21
+ if (msg.includes("Pre-transform error: Failed to load url")) {
22
+ const match = msg.match(idReg);
23
+ if (match && match[0]) {
24
+ const id = match[0].trim();
25
+ if (_constants.DEFAULT_EXTERNAL.includes(id)) {
26
+ return;
27
+ }
28
+ }
29
+ }
30
+ originalWarn(msg, opts);
31
+ };
17
32
  function definePluginViteConfig(opts = {}) {
18
33
  const cwd = process.cwd();
19
34
  const entry = _path.default.resolve(cwd, "src/index.ts");
20
35
  const loaderEntry = _path.default.resolve(cwd, "src/loader.ts");
21
36
  const isProd = process.env.NODE_ENV === "production";
22
37
  return (0, _vite.mergeConfig)((0, _viteBaseConfig.defineViteBaseConfig)({
38
+ customLogger: logger,
23
39
  optimizeDeps: {
24
40
  exclude: _constants.DEFAULT_EXTERNAL
25
41
  },
@@ -32,6 +32,7 @@ export const DEFAULT_EXTERNAL = [
32
32
  "vant",
33
33
  "ant-design-vue",
34
34
  "vxe-table",
35
+ "pinyin-pro",
35
36
  // 图标库相关依赖
36
37
  "@ant-design/icons-vue",
37
38
  "@icon-park/vue-next/es/all",
@@ -1,8 +1,23 @@
1
- import { mergeConfig } from "vite";
1
+ import { createLogger, mergeConfig } from "vite";
2
2
  import path from "path";
3
3
  import { defineViteBaseConfig } from "./vite-base-config.mjs";
4
4
  import { DEFAULT_EXTERNAL } from "../../constants/index.mjs";
5
5
  import { importMapExternalPlugin } from "../vite-plugins/imnport-external-plugin.mjs";
6
+ const idReg = /(?<=resolved id: )[^)]+/;
7
+ const logger = createLogger();
8
+ const originalWarn = logger.error.bind(logger);
9
+ logger.error = (msg, opts) => {
10
+ if (msg.includes("Pre-transform error: Failed to load url")) {
11
+ const match = msg.match(idReg);
12
+ if (match && match[0]) {
13
+ const id = match[0].trim();
14
+ if (DEFAULT_EXTERNAL.includes(id)) {
15
+ return;
16
+ }
17
+ }
18
+ }
19
+ originalWarn(msg, opts);
20
+ };
6
21
  export function definePluginViteConfig(opts = {}) {
7
22
  const cwd = process.cwd();
8
23
  const entry = path.resolve(cwd, "src/index.ts");
@@ -10,6 +25,7 @@ export function definePluginViteConfig(opts = {}) {
10
25
  const isProd = process.env.NODE_ENV === "production";
11
26
  return mergeConfig(
12
27
  defineViteBaseConfig({
28
+ customLogger: logger,
13
29
  optimizeDeps: {
14
30
  exclude: DEFAULT_EXTERNAL
15
31
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/build",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "description": "paas 平台核心包",
6
6
  "main": "dist/index.cjs",
@@ -77,7 +77,7 @@
77
77
  "terser": "^5.46.1",
78
78
  "typescript-eslint": "^8.57.0",
79
79
  "unocss": "66.6.6",
80
- "vite": "^8.0.3",
80
+ "vite": "^8.0.7",
81
81
  "vite-plugin-dts": "^4.5.4",
82
82
  "vite-plugin-lib-inject-css": "^2.2.2",
83
83
  "vite-plugin-static-copy": "^3.3.0",