Skip to content

Instantly share code, notes, and snippets.

@chris-kobrzak
Created January 1, 2016 23:06
Show Gist options
  • Save chris-kobrzak/4e97a958067b88c8d70f to your computer and use it in GitHub Desktop.
Save chris-kobrzak/4e97a958067b88c8d70f to your computer and use it in GitHub Desktop.
Minimal configuration for bundling React classes with ES6 and JSX syntaxes
{
"presets": ["es2015", "react"]
}
echo "{}" > package.json
npm i -S react react-dom
npm i -D webpack babel-core babel-loader babel-preset-es2015 babel-preset-react
var config = {
entry: "./app/app.jsx",
output: {
path: "./dist/",
filename: "bundle.js"
},
module: {
loaders: [{
test: /\.jsx?/,
exclude: /node_modules/,
loaders: [ "babel" ]
}]
}
}
module.exports = config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment