Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// more config: https://d.umijs.org/config
import { defineConfig } from 'dumi';
import path from 'path';

const basePath = process.env.GITHUB_ACTIONS ? '/util/' : '/';
const publicPath = process.env.GITHUB_ACTIONS ? '/util/' : '/';
Expand All @@ -14,4 +15,7 @@ export default defineConfig({
exportStatic: {},
base: basePath,
publicPath,
alias: {
'rc-util/es': path.resolve(__dirname, 'src'),
},
Comment on lines +18 to +20

Choose a reason for hiding this comment

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

medium

For consistency with tsconfig.json, it would be beneficial to also add an alias for the root rc-util package. This ensures that all import paths are handled consistently between TypeScript's path mapping and dumi's build configuration, preventing potential resolution issues in the documentation demos.

  alias: {
    'rc-util/es': path.resolve(__dirname, 'src'),
    'rc-util$': path.resolve(__dirname, 'src/index.ts'),
  },

});
1 change: 0 additions & 1 deletion docs/examples/focus.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useRef } from 'react';
import { useLockFocus } from '../../src/Dom/focus';
import './focus.css';

export default function FocusDemo() {
const containerRef = useRef<HTMLDivElement>(null);
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"paths": {
"@/*": ["src/*"],
"@@/*": ["src/.dumi/*"],
"rc-util": ["src/index.tsx"],
"rc-util": ["src/index.ts"],
"rc-util/es/*": ["src/*"]
}
}
Expand Down
Loading