• Robert Knight's avatar
    Simplify boot script build process · 627620da
    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
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
dev-server Loading commit data...
docs Loading commit data...
embedding-examples Loading commit data...
images Loading commit data...
requirements Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.dockerignore Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.prettierignore Loading commit data...
.python-version Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Dockerfile Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
codecov.yml Loading commit data...
gulpfile.mjs Loading commit data...
package.json Loading commit data...
pyproject.toml Loading commit data...
requirements-dev.in Loading commit data...
rollup-boot.config.mjs Loading commit data...
rollup-tests.config.mjs Loading commit data...
rollup.config.mjs Loading commit data...
tox.ini Loading commit data...
tsconfig.json Loading commit data...
yarn.lock Loading commit data...