Answer the question
In order to leave comments, you need to log in
How to properly use a package script for different platforms?
I have this line in package.json
"scripts": {
"default_linux": "export NODE_ENV=default&& export NODE_MINIFIED=false&& webpack",
"default_windows": "set NODE_ENV=default&& set NODE_MINIFIED=false&& webpack",
"default_linux_min": "export NODE_ENV=default&& export NODE_MINIFIED=true&& webpack",
"default_windows_min": "set NODE_ENV=default&& set NODE_MINIFIED=true&& webpack",
},
$ npm run default_linux # сборка фронтенда под linux
Answer the question
In order to leave comments, you need to log in
Try cross-env , it will be something like this:
"scripts": {
"default": "cross-env NODE_ENV=default NODE_MINIFIED=false webpack",
"default_min": "cross-env NODE_ENV=default NODE_MINIFIED=true webpack"
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question