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

在配置IE兼容是提示 #45

Open
cMing1997 opened this issue Sep 9, 2020 · 2 comments
Open

在配置IE兼容是提示 #45

cMing1997 opened this issue Sep 9, 2020 · 2 comments

Comments

@cMing1997
Copy link

image
按照图中顺序配置之后,打包提示 需要安装 @vue/babel-preset-app 安装之后打包又提示
image
当去掉项目里手动引入之后,同时提示
image

最后查了一下资料发现 直接安装,然后新建 babel.config.js 文件之后,需要配置

module.exports = {
    presets: [["@babel/preset-env",
        {
            useBuiltIns: "entry",
            "corejs": 3
        }]
    ]
}

这里的 @babel/preset-env 跟楼主配置的不一样,我不太懂,不过这样配置之后,打包没有报错了

@cMing1997 cMing1997 reopened this Sep 10, 2020
@Ludidi
Copy link

Ludidi commented Nov 10, 2020

@babel/polyfill 已经弃用,需要在入口文件引入import 'core-js/stable'; import 'regenerator-runtime/runtime'; 官方文档已经给出,作者还没修改吧

@cMing1997
Copy link
Author

@ babel / polyfill已经弃用,需要在入口文件约会import 'core-js/stable'; import 'regenerator-runtime/runtime'; 官方文档已经命名,作者还没修改吧

这个我加上了

import "@babel/polyfill";
import "core-js/stable";
import "regenerator-runtime/runtime";

之所以加上 @babel/polyfill 是因为还是有一些语法 core-js/stableregenerator-runtime/runtime 解析不了的

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

2 participants