My .env
(or .env.local
):
apiURL=https://<dev-url>
My nuxt.config.js
publicRuntimeConfig: {
apiURL: process.env.NODE_ENV === 'production'
? 'https://<prod-url>'
: process.env.apiURL
},
proxy: {
'/api_vue': {
target: process.env.apiURL,
changeOrigin: true
}
},
Everything works well until I add .local
to .env
.
Nuxt says:
Error: [HPM] Missing "target" option. Example: {target: │
nuxt-app | │ "http://www.example.org"}