Answer the question
In order to leave comments, you need to log in
How to make a condition on the passed argument from the console?
There package.json
is a script dev
, I run it yarn run dev
, as a result, the project is built and launched on the localhost. How to implement the ability to pass an argument from the console, for example: yarn run dev --test
, so that later, for example, in App.vue
making a condition for a variable, for example: process.argv === 'test' ? 1 : 0
. When I do it console.log(process)
in a hook created
in a component App.vue
, the array argv
is empty for some reason. Please tell me how to implement this without using additional libraries, such as yargs, minimize, etc ?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question