nuxt-env
nuxt-env copied to clipboard
Adding support for top-level options configuration
Update: Adding top-level configuration module support
This update let users to configure keys via top-level options. I think this enhancement let users organize in a better way the env keys that will be injecting to the project. I only added this enhancement, the behavior to inject via env prop and module options keeps the same Here is an example
module.exports = {
env: {
SOME_COOL_ENV: 'cool value',
},
modules: [
['nuxt-env', {
keys: [
'TEST_ENV_VAR', // Basic usage—equivalent of { key: 'TEST_ENV_VAR' }
{ key: 'OTHER_ENV_VAR', default: 'defaultValue' } // Specify a default value
{ key: 'THIRD_ENV_VAR', secret: true } // Only inject the var server side
{ key: 'ANOTHER_ENV_VAR', name: 'MY_ENV_VAR' } // Rename the variable
]
}]
],
// Now we can configure the keys this way too
nuxtenv: {
keys: [
'TEST_ENV_VAR', // Basic usage—equivalent of { key: 'TEST_ENV_VAR' }
{ key: 'OTHER_ENV_VAR', default: 'defaultValue' } // Specify a default value
{ key: 'THIRD_ENV_VAR', secret: true } // Only inject the var server side
{ key: 'ANOTHER_ENV_VAR', name: 'MY_ENV_VAR' } // Rename the variable
]
}
};
Any suggestion or correction you think must be made, let met know to do it.
Thanks for this awesome project.
PD. I also updated circle pipeline definition to use npm.
Thanks for this PR, I'm hoping this will get merged and released soon because this can be really usefull.