I created my react app with create-react-app script.
I would like to achieve possibility to build 2 different versions of react app which differs by, let's say, single function?
Let's consider 2 possible implementations of fetchSth()
- one would do http GET to some backend, another would call WASM compiled version of backend bundled to module of fetchSth()
. These 2 fetchSth()
cant exist simultaneously so there cannot be some runtime check.
It sounds like there would be need some sort of changing dispatching in imports.
I would achieve that by juggling with symlinks, but is there less barbaric way to achieve this, by let's say defining some environmental variable or passing sth to npm build
?
I use typescript version of react if it differs.
question from:
https://stackoverflow.com/questions/65545406/build-different-production-builds-of-react-app-differing-by-part-of-implementati 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…