Code Monkey home page Code Monkey logo

Comments (8)

melMass avatar melMass commented on July 20, 2024 3

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.

melMass avatar melMass commented on July 20, 2024

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.

melMass avatar melMass commented on July 20, 2024

Re-reading the question I think I misinterpreted it, you mean a way for forks to easily apply their branding?

from hicetnunc.

jmagly avatar jmagly commented on July 20, 2024

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.

jmagly avatar jmagly commented on July 20, 2024

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.

xat avatar xat commented on July 20, 2024

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.

xat avatar xat commented on July 20, 2024

although if we are talking about multiple things that can be configured, a config file might be the better option.

from hicetnunc.

jmagly avatar jmagly commented on July 20, 2024

ENV vars during build should be perfectly acceptable.

from hicetnunc.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.