Created
May 8, 2017 10:31
-
-
Save SigurdMW/3dc41df22d631ca042cbf1624220353c to your computer and use it in GitHub Desktop.
Simple Webpack + babel setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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