1
以下是我的webpack.config.js文件的modules部分。我明白loaders
現在是rules
但我該如何處理查詢部分?將webpack.config.js從1.x轉換爲2.x
這是原來的1.x版本
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['es2015', 'stage-2', 'react']
}
}
]
}
這裏是我迄今爲止的2.x版:
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
use: 'babel-loader',
options: {
// I assume we now use options. How do I handle the presets?
}
}
]
}