Skip to content

Commit d5bd83c

Browse files
committed
fix(site): alias @antv/aimapui-plot to source for CI build
Vercel does a fresh checkout where packages/plot/dist does not exist (dist/ is gitignored). site imports @antv/aimapui-plot, whose package.json exports point at dist/index.es.js, so vite could not resolve its entry — build failed: 'Failed to resolve entry for package "@antv/aimapui-plot"'. core is already aliased to source (commit 0c83624) to avoid building core first. Apply the same pattern to plot: alias @antv/aimapui-plot to ../plot/src/index.ts. plot's source imports only core (already aliased), @antv/l7, react, geojson, and relative css — all resolvable by vite. Verified by removing packages/plot/dist and building site: 62 pages generated successfully.
1 parent 24e090f commit d5bd83c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/site/vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export default defineConfig({
1919
resolve: {
2020
alias: {
2121
'@': resolve(__dirname, 'src'),
22-
// 直接引用 core 源码,避免需要先构建 core 包
22+
// 直接引用源码,避免需要先构建对应包(CI 全新 checkout 仓库内无 dist)
23+
// 注意 plot 别名须在 core 之前,避免前缀歧义
24+
'@antv/aimapui-plot': resolve(__dirname, '../plot/src/index.ts'),
2325
'@antv/aimapui': resolve(__dirname, '../core/src/index.ts'),
2426
},
2527
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'],

0 commit comments

Comments
 (0)