
vue init webpack 安装的示例,请问为什么会这样报错,
main.js 文件中只能使用require倒入模块
.babelrc文件配置
{
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"],
"comments": false
}
新手求助
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你这明显是 babel没有起作用,还在es6的语法在浏览器当中运行。
看看你的webpack配置有没有问题, 记得要在 module下面加上
webpack默认的配置
这个include:projectRoot是什么意思,我把它注释掉就可以使用import 了