APP_NAME=ZEMNA.NET
You can use your custom variable name. I'm using appName
for this demo.
export default { // Insert this option env: { appName: process.env.APP_NAME || 'ZEMNA.NET' } }
After set, we can use this variable using process.env.appName
.
In nuxt.config.js file, You can't access your process.env.appName
environment variable.
So we will use process.env.APP_NAME
from .env file.
export default { head: { title: process.env.APP_NAME, }, }
export default { head() { return { title: 'My article page title' + ' - ' + process.env.appName } }, }