Comments (8)
this could be done with the help of environment variables. create-react-app replaces environment variables in the frontend code if they are prefixed with
REACT_APP_
.
Great so we could have:
REACT_APP_FORK_NAME = teia
REACT_APP_FORK_DESCRIPTION = The Eternal Institute of Art
REACT_APP_FORK_URL = https://teia.art
REACT_APP_FORK_TWITTER = @teia_community
REACT_APP_FORK_LOGO = teia_logo.png # so we assume it's in the root of public
Not sure if it covers everyting
from hicetnunc.
What would it take to get such a config in place?
While looking into the rotatin logos ideas with @SlinkousArt yesterday, I realised that we use create-react app which relies on react-scripts
, AFAIK we cannot further edit the webpack config without ejecting
(this basicaly extracts all the config files from react-scripts, not something we want I think)
One solution that I've used successfully in the past was using Craco.
This would allow us to inject anything in the webpack config and one could do:
import dark_logos from "./logos/dark/*.png"
from hicetnunc.
Re-reading the question I think I misinterpreted it, you mean a way for forks to easily apply their branding?
from hicetnunc.
Im ok with the configuration being something injected for the build, I dont think its necessarily a requirement for us to make it 100% easy to do at runtime, any mirror will likely be doing a build.
from hicetnunc.
correct, if the concern is a mirror running a deployment appearing to be of one site or another being able to change the branding is a must for anyone running a mirror so its clear the user is on a mirror
from hicetnunc.
this could be done with the help of environment variables. create-react-app replaces environment variables in the frontend code if they are prefixed with REACT_APP_
.
see https://create-react-app.dev/docs/adding-custom-environment-variables/
from hicetnunc.
although if we are talking about multiple things that can be configured, a config file might be the better option.
from hicetnunc.
ENV vars during build should be perfectly acceptable.
from hicetnunc.
Related Issues (2)
- Provide a License file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hicetnunc.