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

when i use yarn create umi and add targets in the config doesn't working #2587

Closed
liudq opened this issue Jun 12, 2019 · 4 comments
Closed

Comments

@liudq
Copy link

liudq commented Jun 12, 2019

What happens?

yarn create umi 之后 在配置文件里增加targets 没有生效。

复现步骤

1.yarn create umi
2.umirc.js 里添加如下代码:

targets: {
android: 5,
ios: 7,
safari: 7,
chrome: 58,
ie: 11,
}
3. ios8.0的手机打开空白页面

相关环境信息

"umi": "^2.7.0",
"umi-plugin-react": "^1.8.3",
"dva": "^2.6.0-beta.4",
"react": "^16.8.6",
node版本是:v10.16.0

@xiaohuoni
Copy link
Member

提供几个步骤供你排查一下问题
1、targets需要执行build才会有效,dev是无效的
2、打开build生成的umi.js,如果使用默认配置,那就是dist/umi.js
3、全局搜索一下 const=> ,如果都没有,那说明targets是生效的
你配置这么多,建议你直接设置 ie:9

@liudq
Copy link
Author

liudq commented Jun 13, 2019

您好 排查了一下
1、targets是执行了build的
2、在page下生成了.umi文件夹 里面有umi.js
3、umi.js 里有 const 和 =>

@sorrycc
Copy link
Member

sorrycc commented Jun 14, 2019

dist/umi.js 里搜,有没有 const 和 =>,不是在 pages/.umi/umi.js 里搜。

@sorrycc
Copy link
Member

sorrycc commented Jun 14, 2019

targets 配置肯定是有效的,检查自己的使用问题吧。

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

3 participants