Add support for rollup watch mode
What does this MR do and why?
- Adds a
yarn
command for running Rollup in watch mode (https://rollupjs.org/command-line-interface/#w-watch) - Enables cache for watch mode (https://rollupjs.org/configuration-options/#cache)
- Documents how to use watch mode and updates some other JavaScript-related documentation
If you're only working with frontend JavaScript code, using "rollup watch" allows for seeing compiled changes locally in ~5 seconds instead of ~40 seconds. Thanks to @eread for surfacing the docs on rollup cache.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Checkout this branch.
- Run
yarn watch
. - Modify a .js or .vue file within the
/content/frontend
directory. - Verify that rollup generates a new bundle for changed file.
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.