castarco

joined 2 years ago
1
submitted 1 year ago* (last edited 1 year ago) by castarco@programming.dev to c/react@programming.dev
 

cross-posted from: https://programming.dev/post/3007051

Tutorial on how to create dual ESM+CJS React component libraries.

 

Tutorial on how to create dual ESM+CJS React component libraries.

[–] castarco@programming.dev 2 points 2 years ago

Sourcing the .env requires extra knowledge about shell scripting (even if it's basic knowledge, not everyone has it).

On the other hand, not all shells are POSIX compatible (for example, PowerShell in Windows), so if we want to make a cross-platform solution, it becomes a bit more complicated (and also requires more knowledge than the previous case).

Regarding what you commented about those incompatible "improvements", I understand what you mean, but until now I didn't find any case of this (so far, variable expansion is a native functionality of most shells nowadays).

 

For a while I've noticed that many people use dotenv in a suboptimal way, so yesterday I took the time to write a short article about better usage patterns (pretty basic stuff, so if you are an expert it's likely that you will find it boring):