Answer the question
In order to leave comments, you need to log in
How is set VUE_APP_PROCEDURE=build different from the definition in .env?
Hello, I can declare VUE_APP_PROCEDURE=build in the .env file
and then, for example, from vue.config.js
console.log(process.env.VUE_APP_PROCEDURE); //build
console.log(process.env.VUE_APP_PROCEDURE == "build"); //true
console.log(process.env.VUE_APP_PROCEDURE); //build
//package.json
"scripts": {
"serve": "set VUE_APP_PROCEDURE=serve & vue-cli-service serve",
"build": "set VUE_APP_PROCEDURE=build & vue-cli-service build",
}
console.log(process.env.VUE_APP_PROCEDURE); //build
console.log(process.env.VUE_APP_PROCEDURE == "build"); //fasle
console.log(process.env.VUE_APP_PROCEDURE); //build
Answer the question
In order to leave comments, you need to log in
Alternatively, the problem may be in the variable declaration itself,
inside
"set VUE_APP_PROCEDURE=build & vue-cli-service build"
normal cmd (shell) script, set implementation of variables in cmd, set VUE_APP_PROCEDURE=build &
before the & (which separates the commands for inline use) and you get not build
a build с пробелом
"build": "set VUE_APP_PROCEDURE=build& vue-cli-service build",
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question