Created by: Timer
I'd like to preface this by stating that it is very likely a system like this may never be added to create-react-app
, and is simply being showcased to create discussion around the feasibility of such an idea.
A plugin system is something which proposes to solve many problems.
For instance, we'd like to be able to add support for things like Relay, without increasing the initial installation size of the build tooling.
This could also potentially be applied to things like TypeScript, Sass, et al.
Design goals:
- Zero-configuration, opt-in additional features
- Simple setup (
yarn add react-scripts-plugin-relay
) - Transparent to users who eject
Design constraints:
- Do not increase the initial installation size with excess modules
- Under no circumstances retain a "plugin" system when ejecting; everything must be flattened into a single file
This PR introduces a POC plugin system with initial support for TypeScript.
TODO
-
Install plugin dependencies when ejecting -
Add eject step for plugins (copy files [e.g. tsconfig.json
], etc)