fe-stack 0.0.1 → 0.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fe-stack",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "共享的配置文件集合,用于 Vite、Tailwind、Biome、Prettier 和 TypeScript",
5
5
  "type": "module",
6
6
  "exports": {
package/tsconfig.app.json CHANGED
@@ -9,6 +9,7 @@
9
9
  "erasableSyntaxOnly": true,
10
10
  "noFallthroughCasesInSwitch": true,
11
11
  "noUncheckedSideEffectImports": true,
12
+ "verbatimModuleSyntax": false,
12
13
  "module": "ESNext",
13
14
  "moduleResolution": "Bundler"
14
15
  }
@@ -60,11 +60,24 @@ export function createBaseConfig(dirname, options = {}) {
60
60
  };
61
61
 
62
62
  // 添加 dts 插件
63
+ // 重要:include 需要使用绝对路径,否则在某些项目中会报错
64
+ const dtsInclude = libOptions.dtsInclude || ['src/**/*.ts'];
65
+ const absoluteInclude = dtsInclude.map((pattern) =>
66
+ pattern.startsWith('/') ? pattern : path.resolve(dirname, pattern),
67
+ );
68
+
69
+ const dtsExclude = libOptions.dtsExclude || [];
70
+ const absoluteExclude = dtsExclude.map((pattern) =>
71
+ pattern.startsWith('/') ? pattern : path.resolve(dirname, pattern),
72
+ );
73
+
63
74
  baseConfig.plugins.push(
64
75
  dts({
65
- include: ['src/**/*.ts'],
66
- exclude: libOptions.dtsExclude || [],
76
+ include: absoluteInclude,
77
+ exclude: absoluteExclude,
67
78
  rollupTypes: true,
79
+ // 确保 root 设置为项目根目录
80
+ root: dirname,
68
81
  ...libOptions.dts,
69
82
  }),
70
83
  );