* Update mode-and-env.md
Fixed example of keys, which they should start with VUE_APP_
* Update mode-and-env.md
change position of the tip
* Update docs/guide/mode-and-env.md
Co-Authored-By: Natalia Tepluhina <NataliaTepluhina@users.noreply.github.com>
(cherry picked from commit 149b307f72)
It appears that .env files are only loaded at the start of `vue-cli-service` and are not watched for hot reloads.
**I am actually not sure this is the case for everyone, but is so for me.**
I think it is worth noting because the expectation is that a file at the root of the project would be watched for hot reloads.
(cherry picked from commit b22bedbf94)
* feat: deprecate confusing `baseUrl` option, use `publicPath` instead.
* fix: do not touch CHANGELOG.md
* docs: links referring baseUrl now changed to publicPath
* Include tip about computed env vars
I'm personally using this frivolously in my own footer
```
// vue.config.js
const revision = require('child_process').execSync('git rev-parse HEAD').toString().trim()
const pjson = require('./package.json')
process.env.VUE_APP_COMMIT = `"${revision}"`
process.env.VUE_APP_VERSION = `"${pjson.version}"`
module.exports = {}
```
```
<template>
<footer>
<span>v{{ version }} ({{ commit }})</span>
</footer>
</template>
<script>
export default {
data: function () {
return {
version: process.env.VUE_APP_VERSION,
commit: process.env.VUE_APP_COMMIT
}
}
}
```
# Validation
- I'm using this.
- The inline require doesn't cause lint issues on vue-cli v3 config files. I did a full builds to check.
* tip format match
* tip format
* tip, format
* markdown formatting conflicts with es6 templates
Also, quotes, optional now. interesting. I tried it.
* remove template stray
* filenames are not proper english grammar, yet