There is a problem with cross-env during npm & & serial tasks.

use & & serial tasks in npm, but write

in npm script when using the scaffolding tool in vue-cli

cross-env NODE_ENV=test & & node build/build.js

you can"t get the value of NODE_ENV in build.js, but you can do without & &. Please explain the principle. Isn"t such a serial right?

define and then execute

Mar.03,2021

not serial, directly:

cross-env NODE_ENV=test node build/build.js

this is the instruction format cross-env envSetters command commandArgs
defined by cross-env . If & & is two instructions, then node. cannot get the environment variable


in the scenario cross-env NODE_ENV=local node. / build/index.js & & wepy build-- watch

Menu