This setup works out-of-the-box. It also includes a watcher which re-bundles the JS files whenever a JS file changes.
Write modern JS
- Node Resolve Plugin to use external ES modules.
- CommonJS Plugin to use external CommonJS modules.
- Buble for fast and lightweight transpiling of your code to ES5. If you need more feature support, consider the heavier Babel Plugin.
- Uglify to minify your JS for production.
- ESLint to validate syntax and code style.
- Rollup Watch for fast incremental rebuilds during development.
src/index.js is the main entry point for the JS compile script. So be sure to start there.
Add & configure plugins
To compile your JS for production (incl. minification), run:
npm run build:js
npm run build as this will also run
The compiled JS plus its sourcemap is written to the
debugger are only allowed in development.
To compile your JS (excl. minification) whenever you make a change to a JS file:
npm run watch:js
npm run watch as this will also run
These scripts are configured in