A starter project for building websites using Express.js and Webpack. It provides hot-reloading for both client and server code, as described in the "Express|Webpack - The ultimate guide" ebook. Additionally it offers linting and testing
- Express.js as backend framework
- Webpack with Hmr enabled
- Compile SCSS and process with PostCSS (Autoprefixer included by default)
- Compile client JS using BabelJS
- Production-ready build with asset hashing and minification
- Linting with ESLint and StyleLint
- Server testing with Mocha & Chai
- Client testing with Karma, Mocha & Chai
- Basic CI setup for Travis
Clone the project
git clone [email protected]:express-webpack-ultimate-guide/starter.git
cd starter/
Install dependencies
yarn install
Run the app in development mode
yarn start
Point your browser to http://localhost:3000
yarn lint:css # run StyleLint
yarn lint:js # run ESLint
Note: linting is also integrated in webpack, so you'll also see the warnings while running yarn start
yarn test:client # run client tests using Karma and watch
yarn test:server # run server tests using Mocha and watch
yarn test:client:ci # run client tests once for CI
yarn test:server:ci # run server tests once
I wrote a book on how to integrate a Webpack dev server into an Express app.
- Buy on leanpub: https://leanpub.com/express-webpack-ultimate-guide
- Read online: https://express-webpack-ultimate-guide.github.io/