@nuxtjs/separate-env
Separate env module - Tear your variables apart!
Features
- Separated environment variables for
serverandclientbuild - Thoroughly tested!
Setup
- Add
@nuxtjs/separate-envdependency to your project using yarn or npm
Configuration
To define environment variables only available on server/client side,
use the env key of your nuxt.config.js and nest the variables
in a server or client object:
{
env: {
server: {
ONLY_SERVER: 'yup',
DIFFERENT_ON_BOTH: 'server'
},
client: {
ONLY_CLIENT: 'okay',
DIFFERENT_ON_BOTH: 'client'
},
normalEnvVariableThatWillBeAvailableEverywhere: 'Hi'
}
}
That's it! You are good to go.
Caveats
IMPORTANT: Be aware that server-side includes every first render of your application.
Your secret tokens won't be included anywhere **except you use them **
Development
- Clone this repository
- Install dependencies using
yarn installornpm install - Start development server using
npm run dev
License
Copyright (c) Alexander Lichter
Related Packages
nuxt-translation-manager
Simple and easy to use translation manager for nuxt and nuxt-i18n that allows to...
16,873
19
@traum-ferienwohnungen/nuxt-advanced-healthcheck
Module for adding healthcheck urls to a nuxt project
2,621
3
@agency-undone/nuxt-module-ipfs
A Nuxt module that enables nuxt routing for both the intended path and IPFS gate...
945
8
Version History
| Version | Released | License |
|---|---|---|
| 0.0.1 | MIT |