why create two process?
mh0625 opened this issue · comments
Mia commented
cross-env
version: 5.2.0node
version: 10.4.1npm
(oryarn
) version: 6.1.0
Relevant code or config
package.json scripts:
"build-test": "cross-env ENV=test nuxt build",
What you did:
"build": "nuxt build", // only one process
"build-test": "cross-env ENV=test nuxt build", // have two process
What happened:
Problem description:
I want to use cross-env modify environment, when I execute npm run build-test
command, it will create two process, why?
Rafael Rocha commented
Because your actually calling the nuxt build
again. It's a matter of package.json script scoping. just use "build-test": "cross-env ENV=test build"
. Since build
is already defined above.
Caíque de Castro Soares da Silva commented
Did it solve the problem?
Kent C. Dodds commented
You have one process to run cross-env and cross-env spawns another process with the right environment variables set. There's no other way to do this I'm afraid.