A ready to run, framework agnostic, zero configuration webpack 3 and webpack-dev-server build tool, without project generation.
Babel with ES2016, JSX, TypeScript, Sass, Less and autoprefixer are supported by default.
Included: dev server, unit tests, coverage, hot module replacement, and more ! (see features)
npm i -g runpack
You may also use it as a dev dependency.
Create an index.js or main.js file at the root of your project. You may also use .jsx, .ts or .tsx.
A package.json is not necessary, but if present and the main field is an existing file, it will be used as the entry point.
An index.html file is not mandatory, but if one is found next to the main file, it will be used.
// ES5: require('./path/to/file.css'); // ES6 or TypeScript: import './path/to/file.css';
Run the developpment server (default port is already 3000):
runpack server --port 3000
Run the developpment server with cheap sourcemaps (faster builds but less precise sourcemaps, enable it on large projects):
runpack server --cheap-sourcemap
Run the developpment server with a backend server:
runpack server --proxy http://localhost:8080
Run the developpment server with a backend server and html5 history API (mandatory if using both proxy and html5 type routing):
runpack server --proxy http://localhost:8080 --proxy-root /rest --proxy-root /api
Build production files in /dist:
Run server with basic hot module replacement (styles are supported):
runpack server --hot
Run server with hot module replacement and React support (you must use and module.hot.accept from react-hot-loader as in react-hot-ts to support hot module replacement in the application code):
runpack server --hot-react
Create a production archive (zip and .tar.gz are supported):
runpack package --type tgz
Run tests with mocha:
Run tests and watch files:
runpack test --watch
Run tests with mocha and generate test reports:
runpack test --test-report
Run tests with mocha and generate a coverage report:
runpack test --coverage
Dump build scripts, generate npm commands and install dev depenencies (may be irreversible !):
runpack server --favicon path/to/favicon
Get help on a specific command:
runpack <command> --help