-
Robert Knight authored
The boot script used to be generated in several stages: 1. The files in `src/boot/` were bundled into `build/scripts/boot.bundle.js` with underscore-prefixed placeholders for certain data. 2. A gulp task would generate `build/manifest.json` which included hashes of assets in the build dir 3. Another gulp task would read `build/scripts/boot.bundle.js` and use string replacements to replace the placeholders with final values and write the result to `build/boot.js` This commit simplifies the process by combining stage (1) and (3). Add a separate Rollup config, rollup-boot.config.mjs, which builds `build/boot.js` directly from the `src/boot/index.js` entry point, using @rollup/plugin-replace to replace placeholders with data during the build. The code to generate the manifest in step (2) has been replaced with the manifest-generation code from the @hypothesis/frontend-build package, which is also shared with other projects. This change allows removal of several dependencies from the project, and means that we only have one way to replace `__PLACEHOLDER__` placeholders in JS files during the build, rather than two different ones. One minor change here is that only JS, CSS and sourcemap files are referenced in the manifest. Font files are not mentioned since the code that loads them (KaTeX) doesn't make use of the manifest.
627620da
This project manages its dependencies using
Yarn.
Learn more