Created
January 1, 2016 23:06
-
-
Save chris-kobrzak/4e97a958067b88c8d70f to your computer and use it in GitHub Desktop.
Minimal configuration for bundling React classes with ES6 and JSX syntaxes
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
Show hidden characters
{ | |
"presets": ["es2015", "react"] | |
} |
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
echo "{}" > package.json | |
npm i -S react react-dom | |
npm i -D webpack babel-core babel-loader babel-preset-es2015 babel-preset-react |
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
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