解决方案:使用babel-polyfill。
1、下载依赖
npm install --save babel-polyfill
2、main.js中引入
import ‘babel-polyfill‘;
3、在webpack.base.conf.js文件中将
module.exports = {
context: path.resolve(__dirname, ‘../‘),
entry: {
app: ‘./src/main.js‘,
}
module.exports = {
context: path.resolve(__dirname, ‘../‘),
entry: {
app: ["babel-polyfill", "./src/main.js"],
}
原文地址:https://www.cnblogs.com/worldforest/p/10300161.html
时间: 2024-11-06 11:44:48