Skip to content

Instantly share code, notes, and snippets.

@SigurdMW
Created May 8, 2017 10:31
Show Gist options
  • Save SigurdMW/3dc41df22d631ca042cbf1624220353c to your computer and use it in GitHub Desktop.
Save SigurdMW/3dc41df22d631ca042cbf1624220353c to your computer and use it in GitHub Desktop.
Simple Webpack + babel setup
// remember to run first: npm i --save-dev webpack path babel-core babel-preset-es2015 babel-loader
/* Simplistic .babelrc file:
{
"presets": ["es2015"]
}
*/
var path = require('path');
module.exports = {
entry: './src/app.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'app.bundle.js'
},
module: {
rules: [{
loader: "babel-loader",
// the loader which should be applied, it'll be resolved relative to the context
// -loader suffix is no longer optional in webpack2 for clarity reasons
// see webpack 1 upgrade guide
options: {
presets: ["es2015"]
},
}]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment