@gct-paas/build 0.1.5-dev.4 → 0.1.5-dev.6

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.
@@ -24,6 +24,7 @@ function definePkgDevViteConfig(opts = {}) {
24
24
  const cwd = process.cwd();
25
25
  const outDir = _path.default.resolve(cwd, "es");
26
26
  rf.sync(outDir);
27
+ const isDev = process.env.NODE_ENV === "development";
27
28
  let pkgDependencies = [];
28
29
  try {
29
30
  const pkgJsonPath = _path.default.resolve(cwd, "package.json");
@@ -44,6 +45,7 @@ function definePkgDevViteConfig(opts = {}) {
44
45
  outDir,
45
46
  target: "esnext",
46
47
  minify: false,
48
+ sourcemap: isDev,
47
49
  rollupOptions: {
48
50
  external: id => {
49
51
  if (pkgDependencies.some(dep => id === dep || id.startsWith(dep + "/"))) {
@@ -73,14 +75,15 @@ function definePkgDevViteConfig(opts = {}) {
73
75
  },
74
76
  plugins: [(0, _viteTsconfigPaths.default)(), (0, _pluginJson.default)(), (0, _pluginVue.default)(), (0, _pluginVueJsx.default)(), (0, _vitePluginLibInjectCss.libInjectCss)(), (0, _vitePluginDts.default)({
75
77
  outDir: [outDir],
78
+ compilerOptions: {
79
+ declarationMap: isDev
80
+ },
76
81
  // 排除测试目录,以及测试文件
77
82
  exclude: ["**/test/**", "**/*.test.ts", "**/*.test.tsx", "**/*.spec.ts", "**/*.spec.tsx"]
78
83
  }), (0, _vitePluginStaticCopy.viteStaticCopy)({
79
84
  targets: [{
80
- // 匹配 src 目录下所有深层层级的 .d.ts 文件
85
+ // src/types 目录下的文件复制到编译输出目录
81
86
  src: "src/types",
82
- // 关键:dest 设置为 '.' 配合下面的 transform 逻辑
83
- // 或者直接指定输出到 dist 里的某个子目录,比如 'types'
84
87
  dest: "."
85
88
  }]
86
89
  })]
@@ -43,7 +43,7 @@ function defineProjectViteConfig(gctOpts = {}, opts = {}) {
43
43
  const branchSummary = await git.branch();
44
44
  const httpProxyKey = Object.keys(_gctOpts.httpProxyConfig).find(key => {
45
45
  return key.startsWith(branchSummary.current);
46
- }) || "paas-dev";
46
+ }) || "paas-test";
47
47
  const httpProxy = _gctOpts.httpProxyConfig[httpProxyKey];
48
48
  return (0, _util.mergeConfig)({
49
49
  base: "./",
@@ -15,6 +15,7 @@ export function definePkgDevViteConfig(opts = {}) {
15
15
  const cwd = process.cwd();
16
16
  const outDir = path.resolve(cwd, "es");
17
17
  rf.sync(outDir);
18
+ const isDev = process.env.NODE_ENV === "development";
18
19
  let pkgDependencies = [];
19
20
  try {
20
21
  const pkgJsonPath = path.resolve(cwd, "package.json");
@@ -36,6 +37,7 @@ export function definePkgDevViteConfig(opts = {}) {
36
37
  outDir,
37
38
  target: "esnext",
38
39
  minify: false,
40
+ sourcemap: isDev,
39
41
  rollupOptions: {
40
42
  external: (id) => {
41
43
  if (pkgDependencies.some(
@@ -71,6 +73,9 @@ export function definePkgDevViteConfig(opts = {}) {
71
73
  libInjectCss(),
72
74
  dts({
73
75
  outDir: [outDir],
76
+ compilerOptions: {
77
+ declarationMap: isDev
78
+ },
74
79
  // 排除测试目录,以及测试文件
75
80
  exclude: [
76
81
  "**/test/**",
@@ -83,10 +88,8 @@ export function definePkgDevViteConfig(opts = {}) {
83
88
  viteStaticCopy({
84
89
  targets: [
85
90
  {
86
- // 匹配 src 目录下所有深层层级的 .d.ts 文件
91
+ // src/types 目录下的文件复制到编译输出目录
87
92
  src: "src/types",
88
- // 关键:dest 设置为 '.' 配合下面的 transform 逻辑
89
- // 或者直接指定输出到 dist 里的某个子目录,比如 'types'
90
93
  dest: "."
91
94
  }
92
95
  ]
@@ -36,7 +36,7 @@ export function defineProjectViteConfig(gctOpts = {}, opts = {}) {
36
36
  const branchSummary = await git.branch();
37
37
  const httpProxyKey = Object.keys(_gctOpts.httpProxyConfig).find((key) => {
38
38
  return key.startsWith(branchSummary.current);
39
- }) || "paas-dev";
39
+ }) || "paas-test";
40
40
  const httpProxy = _gctOpts.httpProxyConfig[httpProxyKey];
41
41
  return mergeConfig(
42
42
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/build",
3
- "version": "0.1.5-dev.4",
3
+ "version": "0.1.5-dev.6",
4
4
  "type": "module",
5
5
  "description": "paas 平台核心包",
6
6
  "main": "dist/index.cjs",
@@ -107,5 +107,6 @@
107
107
  "tsx": "^4.21.0",
108
108
  "typescript": "^5.9.3",
109
109
  "unbuild": "^3.6.1"
110
- }
110
+ },
111
+ "gitHead": "2f73ef719a7c5e53eb9c9ebc1f5f46148fda4831"
111
112
  }