Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Unified builder plugin system #511

Open
@guybedford

Description

@guybedford

While the hooks we have are complete in providing the ability to have loader plugins in the browser, and to alter the loader hooks as well, an "official" plugin system enables third-party ecosystems to properly grow. At the moment we're really only growing these ecosystems around module loader plugins, but there is scope to have loader hook plugins.

For example this would enable ecosystem plugins for things like code coverage, alternative minification and code optimization etc etc. And it's really important to have such an ecosystem.

By focusing first on the builder, it may be as simple as simply providing a plugin API as a sugar shortcut to the hooks and documenting it.

Something like:

var builder = new Builder();

builder.config({
  plugins: ['x']
});

Where the plugin is itself loaded as a module and then simply provides implementations for the loader hooks, as if we had done:

builder.config({
  fetch: customFetch,
  translate: customTranslate
});

etc etc. It's effectively very similar to what Rollup did here too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions