Roots Discourse

Sage 10 - Is there something like config-local.json in Sage 10

Using Sage 9 within a team of 2 to 3 developpers we used to leverage config-local.json to flatten the differents between our dev environments (we all have other customers and projects).

Is there something like this in Sage 10 ?

1 Like

Did you ever figure this out? I’m having the same issue.

No, I couldn’t (hadn’t to) for now, but there are several solutions I can see.

A first idea would be to add an untracked config.js file somewhere that I could require in my webpack.mix.js.

Another approach would be to leverage the dotenv js module to import each environment configuration directly from a .env file. This would make sense since most of my projects are Bedrock’s ones.

FWIW this is the approach I’d recommend, and is the one I use to deal w/ similar issues. .env files are used frequently for a lot of stuff, so they’re well understood and are less likely to cause weird edge cases or get you in trouble for doing non-standard stuff. (Plus you can probably just add .env to your global gitignore and not have that come back to bit you.)