R
R
Redrik_Shuhart2018-11-05 19:20:54
Vue.js
Redrik_Shuhart, 2018-11-05 19:20:54

Is there some sort of environment variable?

Tell me, please, is it possible, for example, in a component to use some kind of condition responsible for the environment?
For example:

var url;
if ( PRODUCTION ) {
    url = 'xxx';
}

if ( DEVELOPMENT ) {
    url = 'yyy';
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Rak, 2018-11-05
@Redrik_Shuhart

process.env. this is provided that you set it in the webpack config or in the package.json script
cross-env NODE_ENV=development

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question