webpack-js-boilerplate
Webpack JS Boilerplate is a simple (but usefull) Vanilla JS front-end boilerplate for building small (but robust), and adaptable demos, web apps or sites.
Features
- EditorConfig ready;
- ESLint ready (with airbnb style guide integration;
- Babel ready;
- Webpack Environment Splitting (Development e Production);
- Dev-Server (with hot-reload) ready;
- Production Bundle package build ready.
Quick Start
- Make sure that you have Node.js v8 and npm v5 or above installed;
- Clone this repo using
git clone https://github.com/fsciuti/webpack-js-boilerplate.git <YOUR_PROJECT_NAME>
; - Move into the appropriate <YOUR_PROJECT_NAME> directory;
- Run from terminal:
npm i
in order to install dependencies; - Use src/index.js file like a project entry point script;
- Use src/index.html file like a project entry point template.
How to run
- development environment: run
npm run start
and open http://localhost:8080 into your browser; - production environment: run
npm run build
and enjoy.
N.B. If 8080 port is busy, Webpack-Dev-Server will change the port dinamically. ;)
How to update
Webpack
- update build-utils/webpack.common.js file;
- update build-utils/webpack.dev.js or build-utils/webpack.prod.js files depending on enviroment to be updated.
ESLint
- update .eslintrc.json file.
Maintained with ❤️ by me and Acadevmy!