4 ms·
You don't need any of those if you are doing a node project, yeah, but if you want to do any work on the browser, you're gonna need to transpile anyway, so it's
by aaron-lebo 9y ago
You don't need any of those if you are doing a node project, yeah, but if you want to do any work on the browser, you're gonna need to transpile anyway, so it's something people should be aware of.
Plus it's literally a 20 line config file to do so.
module.exports = {
entry: './src/app.js',
output: {
path: './bin',
filename: 'app.bundle.js',
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}]
}
}
Include your app.bundle.js file in your webpage and you are good to go.
- nilliams 9y agoSoon with the new webpack-cli, you'll just be able to 'webpack init': https://medium.com/webpack/announcing-the-new-webpack-cli-75ce1d9b8663 https://medium.com/webpack/announcing-the-new-webpack-cli-75...