• Robert Knight's avatar
    Replace Browserify with Rollup · bcf7ef0a
    Robert Knight authored
    Replace Browserify with Rollup as a module bundler. This brings several
    advantages:
    
    - It is a more modern bundler that has better support in the ecosystem,
      more active maintenence, fewer dependencies and is easier to write plugins for.
      The core team also maintain most of the plugins that we need.
    
    - It has native support for modern platform features like ES modules,
      including dynamic import for lazy-loading of functionality.
    
    - It generates smaller bundles due to its ability to do tree shaking and scope hoisting.
    
    The new bundles are generated as ES modules rather than UMD / IIFE bundles.
    Our target browsers now all support ES modules and this will enable us to use
    native static/dynamic imports for code splitting or lazy-loading of
    functionality in future.
    
    The initial Rollup build generates one bundle per application (boot script,
    annotator, sidebar). This simplifies the build process and minimizes production
    bundle size, at the cost of making incremental updates during development
    slightly slower.
    
    Build performance is currently similar to or a little slower than Browserify.
    We can optimize this by adding caching of transforms (mainly Babel) and
    pre-building of a vendor bundle containing large dependencies.
    
    As part of changing the bundler this also changes how the code is packaged
    for tests.  We now do the bundling ourselves rather than using a Karma
    integration. This makes it much easier to inspect the processed code and fix
    problems. It also makes it easier to optimize the bundle building in future.
    bcf7ef0a
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.js Loading commit data...
package.json Loading commit data...
pyproject.toml Loading commit data...
requirements-dev.in Loading commit data...
rollup-tests.config.js Loading commit data...
rollup.config.js Loading commit data...
tox.ini Loading commit data...
tsconfig.json Loading commit data...
yarn.lock Loading commit data...