A full-featured Webpack setup with hot-reload, lint-on-save, unit testing & css extraction.
This is a project template for webapp-cli.
$ npm install -g web-app-cli
$ webapp init webpack my-project
$ cd my-project
$ npm install
$ npm run dev
-
npm run dev
: first-in-class development experience.- Webpack for single file.
- State preserving hot-reload
- State preserving compilation error overlay
- Lint-on-save with ESLint
- Source maps
-
npm run build
: Production ready build.- JavaScript minified with UglifyJS.
- HTML minified with html-minifier.
- CSS across all components extracted into a single file and minified with cssnano.
- All static assets compiled with version hashes for efficient long-term caching, and a production
index.html
is auto-generated with proper URLs to these generated assets.
-
npm run unit
: Unit tests run in PhantomJS with Karma + Mocha + karma-webpack.- Supports ES2015 in test files.
- Supports all webpack loaders.
- Easy mock injection.
-
npm run e2e
: End-to-end tests with Nightwatch.- Run tests in multiple browsers in parallel.
- Works with one command out of the box:
- Selenium and chromedriver dependencies automatically handled.
- Automatically spawns the Selenium server.