0
我正嘗試在使用Webpacker的Rails應用程序中設置idx
babel插件。使用Rails 5 webpacker安裝babel插件
https://github.com/facebookincubator/idx
https://github.com/rails/webpacker
我怎樣才能做到這正常嗎?
我正嘗試在使用Webpacker的Rails應用程序中設置idx
babel插件。使用Rails 5 webpacker安裝babel插件
https://github.com/facebookincubator/idx
https://github.com/rails/webpacker
我怎樣才能做到這正常嗎?
好吧我想通了。必須將其添加到babel.js加載程序。
// config/webpack/loaders/babel.js
module.exports = {
test: /\.js(\.erb)?$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
plugins: [
require('babel-plugin-idx'),
],
presets: [
['env', { modules: false }]
]
}
}