How to pass env variables to vue application?
MykytaLiashenko opened this issue · 4 comments
MykytaLiashenko commented
Hi. I need to pass api url to vue application for vue-resource .
I tried --env.VARIABLE_NAME xxx
and VARIABLE_NAME=xxx yarn dev
but nothing works.
egoist commented
Just tested it, vbuild --env.VARIABLE_NAME xxx
should work.
MykytaLiashenko commented
What about yarn dev
command?
egoist commented
You need to update npm scripts in package.json
.
Or yarn dev -- [extra arguments]
like yarn dev -- --env.VARIABLE_NAME xxx
for temporary use.
MykytaLiashenko commented
yarn dev -- [extra arguments]
is the best solution.
Thanks.