Rails 5:尝试添加babel插件

时间:2018-09-19 20:35:03

标签: ruby-on-rails heroku babeljs

我有一个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"

我还需要做什么?

0 个答案:

没有答案