Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: alias 在 Live demo 中不生效 #2135

Closed
sakura-flutter opened this issue Jun 4, 2024 · 1 comment
Closed

bug: alias 在 Live demo 中不生效 #2135

sakura-flutter opened this issue Jun 4, 2024 · 1 comment

Comments

@sakura-flutter
Copy link

Version

2.3.7

OS Version

window 11

Node.js Version

18.12.0

Browser Version

Chrome 125

Link to minimal reproduction

https://codesandbox.io/p/devbox/zv29g5?migrateFrom=xz2w39

Steps to reproduce

markdown 中 import DemoBlock from '@/demoblock' 这种引入方式在页面编辑代码时可以正常实时预览,
但是换成 import DemoBlock from 'demoblock' 后只可以预览,当修改代码时预览会出现以下错误:

image

已在 .dumirc.ts 中配置了 alias

What is expected?

在页面上编辑代码应该也是可以实时预览

What is actually happening?

Live demo 没有识别到 alias?

Any additional comments? (optional)

No response

@sakura-flutter
Copy link
Author

已解决,参考 https://github.com/ant-design/ant-design/blob/3952fd8312a20bbbb1dc4ec2f2d66e9f1d773a7e/.dumirc.ts#L40

alias: {
  'foo': path.join(__dirname, 'your path'),
},

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant