javascript - How to configure a variable in the production environment of vue+webpack?
習慣沉默
習慣沉默 2017-05-24 11:38:54
0
1
730

The current project has a form of url=AAA "/api/list-101.json". I hope that this AAA can take different values ​​according to different environments: "" or "xxxxx", for example, in Let him take "" when npm run dev, and take "xxxxx" when npm run build. How to configure it to achieve this?

習慣沉默
習慣沉默

reply all(1)
仅有的幸福

If you are using cli, you can judge based on process.env.NODE_ENV. This value is production when building and development when dev.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template