Hacking create-react-app to work with Preact & LESS without ejecting
- Preact is better at living together with external libraries and Custom Elements than React,
- Preact is smaller, even when adding
preact-compat(React vs Preact),
- Preact's codebase is small enough to read in a single sitting,
- Preact didn't have license issues,
- We didn't want to
ejectand lose getting updates to
- We didn't want to change to another bootstrap framework or write our own,
- My cat told me to do it.
I broke the hack down to 5 steps and you can view them as Pull Requests here in this repo:
Step 0 - Initialize using
We bootstrap our repo with
Step 1 — Switch from
This is the hack itself, we trick
create-react-app into using
preact by aliasing all the related modules.
Step 2 — Set
babel’s IE target from 9 to 11
We don't need to support IE9 or IE10, let's not build for them either!
Step 3 — Add
Time to pre-process
Step 4 — Add
This is how you can add extra