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

🧐[问题 | question] pro中如何关闭dynamicImport? #11346

Closed
udoless opened this issue Sep 30, 2024 · 0 comments
Closed

🧐[问题 | question] pro中如何关闭dynamicImport? #11346

udoless opened this issue Sep 30, 2024 · 0 comments

Comments

@udoless
Copy link

udoless commented Sep 30, 2024

🧐 问题描述 | Problem description

我只想让我的js代码打包进一个文件里,我根据umi文档中的方法,会报错。似乎pro里用的是max,不能用这种方式关闭dynamicImport。请问pro中如何关闭dynamicImport呢?

"@umijs/max": "^4.1.1",
"antd": "^5.13.2",

💻 示例代码 | Sample code

.umirc.ts内容如下

export default {
    extraBabelPlugins: process.env.NODE_ENV === 'production' 
      ? ['babel-plugin-dynamic-import-node'] 
      : []
  }

🚑 其他信息 | Other information

报错信息如下:
image

OS:

Node:

浏览器 | browser:

@udoless udoless closed this as completed Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant