我安装了grunt-babel,以便让IE11用户在我们的网站上。现在,对于这些用户来说,这个网站已经崩溃了。我已经取得了很大的成功,但我得到了以下错误,我不知道如何解决。
ReferenceError: regeneratorRuntime is not defined看起来不推荐多填充,所以我想知道什么是最好的解决方案。
按照和David的建议,我安装了重新生成器/运行时包,现在正在获得一个错误require is not defined
此代码将通过浏览器运行。我的公司正在使用一个定制的CMS,它要求我们压缩主题文件,还有很多部分需要动态填充文本,这是使用ES6模板文字的原因之一。
package.json文件
{
"name": "Some Site",
"version": "1.0.0",
"description": "",
"main": "Gruntfile.js",
"dependencies": {
"regenerator-runtime": "^0.13.3"
},
"devDependencies": {
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/preset-es2015": "^7.0.0-beta.53",
"babel-preset-es2015-nostrict": "^6.6.2",
"grunt": "^1.0.4",
"grunt-autoprefixer": "^3.0.4",
"grunt-babel": "^8.0.0",
"grunt-contrib-compress": "^1.5.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-cssmin": "^3.0.0",
"grunt-contrib-imagemin": "^3.1.0",
"grunt-contrib-less": "^2.0.0",
"grunt-contrib-uglify": "^4.0.1",
"grunt-contrib-watch": "^1.1.0",
"grunt-purifycss": "^0.1.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}.babelrc文件
{
"presets": ["@babel/preset-env"]
}发布于 2019-12-03 19:13:40
您需要安装并运行此软件包。
https://stackoverflow.com/questions/59163682
复制相似问题