我有一个Rails 5应用程序,正在尝试添加transform-template-literals babel插件。运行后由于某种原因:
npm install --save-dev @babel/plugin-transform-template-literals
并更新我的.babelrc
文件:
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": "> .25%, not dead",
"uglify": true,
"ie": 11
},
"useBuiltIns": true
},
]
],
"plugins": [
"syntax-dynamic-import",
"transform-object-rest-spread",
["transform-class-properties", { "spec": true }],
"@babel/plugin-transform-template-literals"
]
}
部署到Heroku时出现以下错误:
Module build failed: ReferenceError: Unknown plugin "@babel/plugin-transform-template-literals"
我还需要做什么?