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 +1 -1
- package/tsconfig.app.json +1 -0
- package/vite.config.base.js +15 -2
package/package.json
CHANGED
package/tsconfig.app.json
CHANGED
package/vite.config.base.js
CHANGED
|
@@ -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:
|
|
66
|
-
exclude:
|
|
76
|
+
include: absoluteInclude,
|
|
77
|
+
exclude: absoluteExclude,
|
|
67
78
|
rollupTypes: true,
|
|
79
|
+
// 确保 root 设置为项目根目录
|
|
80
|
+
root: dirname,
|
|
68
81
|
...libOptions.dts,
|
|
69
82
|
}),
|
|
70
83
|
);
|