umijs / dumi

📖 Static Site Generator for component library development
https://d.umijs.org
MIT License
3.57k stars 1.18k forks source link

bug: md中代码块的import/export无法通过编译 #2039

Closed GeorgeHcc closed 7 months ago

GeorgeHcc commented 7 months ago

Version

2.3.0-beta.7

OS Version

win10

Node.js Version

20.11.0

Browser Version

Chrome :122.0.6261.112

Link to minimal reproduction

https://github.com/ant-design/ant-design

Steps to reproduce

fork ant-design仓库 安装依赖后 启动 "start": "cross-env PORT=8001 dumi dev",

What is expected?

能正常编译

What is actually happening?

Failed to compile

SyntaxError: F:\Code\ant-design\docs\spec\motion.en-US.md: 'import' and 'export' may only appear at the top level. (8:4)
   6 | /**
   7 |  * inline: true
>  8 |  */ import { Col, Row } from 'antd';
     |     ^
   9 | const text = [
  10 |     {
  11 |         title: 'Natural',

Any additional comments? (optional)

No response

PeachScript commented 7 months ago

大概率是这个问题,检查下安装环境吧 #1701