hi i want to start a pr…

1 minute read

hi. i want to start a project with nx. we have some different styles (5) for the same application. what do you think is the best setup for this?

  1. one “core” library with 5 applications?
  2. one application with different configurations within the angular.json?
  3. ?


Hey Sebastian by different styles do you mean visual styles? If so what you could so is have your one core application and then have 5 different “style.scss” files with your different styles then have 5 different configurations in your angular.json that have the same build params but each have a different file replacements that uses a different style.scss file. Your angular.json should already have this in there for the environment.ts files so should be an easy copy from that.

hi jay, thanks for your response. currently we did it without nx and we have different styles.scss managed by angular.json. in the mean time i have seen some nx videos and read some tuts and somebody says: “99% of the app logic should be in the lib. the apps are only for styles and environment.” so if this is true maybe its god to have this structure: • myapp_client1 • myapp_client2 • …. • lib/myapp within the myapp_client1 some client styles. within the lib/myapp the shared styles

its a little bit frustrating to find only nx-hello-world (or only one todo app) examples. real life example for file structure would be awesome

Do your 5 applications have different logic? Or do they only have different styles(SCCS/CSS/less/etc)?

some little different logic. one app has a different icon font and we are working there with a differen Icon class. otherwise only some different texts. i think the rest is identically

I would do file replacements then. Since that kind of stuff should be able to be swapped out at build time.

Then you only have 1 app. And just need to manage the different configurations

Much easier than managing 5 different app codebases

ok. thx for your sharing your experience