Setting up Webpack for ES6, React, SASS and Bootstrap
If you want to start using Webpack as a module bundler for your React application, you can find great tutorials with detailed instructions (1, 2, 3). In this short blog post I want to share my webpack config, which is based on these tutorials.
In development, I use this config to bundle ES6, React, SASS and Twitter Bootstrap. Babel transpiles JSX and ES6 to ES5 and introduced plugins and presets which we can define as a query parameters. Webpack provides a little Express node.js server called webpack-dev-server, which I use as my dev environment. PostCSS is a post-processor that allows transformation of CSS with JS plugins, I use Autoprefixer in this config. Webpack-merge is a little helper which concatenates arrays and merges objects in your config and npm-install-webpack-plugin is great plugin which automatically installs npm dependencies. Sample project with this webpack config is viewable on GitHub.
3 COMMENTS
[…] Setting up Webpack for ES6, React, Sass and Bootstrap […]
This is for someone who is looking for VUE.JS 2 solution:
Stack overflow: http://stackoverflow.com/a/43383449/1292050
Git setup https://github.com/syed-haroon/vue-js-2-basic-setup
I also encourage you to take look at this URL for more sophisticate work setup https://github.com/prograhammer/example-vue-project
Thanks for sharing. If I have a vue project, I will try it out 🙂