I use dotenv module to apply .env in my projects.
In windows, prefix cross-env should be put before every setting environment scripts in package.json.
For example, this is my yarn build command in windows.
scripts: {
...
"build": "rm -rf dist/ && cross-env NODE_ENV=production yarn build:client && cross-env NODE_ENV=production yarn build:server",
...
}
I use both window and mac OS in different device, don't want to remove / put cross-env prefix each times I change my device.
Is there ways to automative scripts I can make to edit scripts section in package.json?