Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineConfig({
},
resolve: {
alias: {
'@': path.resolve(__dirname, '../src'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Adding the '@' alias, which points to the src directory, introduces a second way to import library modules and allows for deep-linking into the source code (e.g., import ... from '@/graph'). This can lead to inconsistencies and create examples that are not representative of how a consumer would use the published package.

To ensure examples reflect real-world usage and rely only on the public API, it's better to exclusively use the '@antv/x6' alias, which correctly simulates a package import. This prevents accidental reliance on internal implementation details. It is recommended to remove this new alias.

'@antv/x6': path.resolve(__dirname, '../src/index.ts'),
},
},
Expand Down