When I run babel by itself it reads the .babelrc and transpiles as expected. However, when I run webpack with babel-loader, the outputted code is very similar to the original code, but I would like for it to work in older browsers.
.babelrc
{
"presets": ["env"]
}
webpack.config.js
module.exports = {
entry: __dirname + '/src/index.js',
output: {
filename: 'bundle.js',
publicPath: '/dist',
path: __dirname + '/dist'
},
module: {
loaders: [
{
test: /\.js?/,
include: __dirname + 'src',
loader: 'babel-loader'
}
]
},
devServer: {
inline: true,
port: 8080,
historyApiFallback: {
index: 'index.html'
}
}
}