A nuxt.js module that allows us to load multiple configuration files
The module loads configurations files.
- Add
nuxt-configuration
dependency to your project
yarn add nuxt-configuration # or npm install nuxt-configuration
- Add
nuxt-configuration
to themodules
section ofnuxt.config.js
{
modules: [
// Simple usage
'nuxt-configuration',
// With options
['nuxt-configuration', { /* module options */ }]
]
}
{
modules: [
'nuxt-configuration'
],
dotenv: {
/* module options */
}
}
TODO explains options...
After creating your config files, simply run your usual yarn dev
or npm run dev
.
You can use this.$config in your components
This module won't overload the environment variables of the process running your build.
If you need to use variables from your .env file at this moment,
just append require('dotenv').config()
to your configuration files :
require('dotenv').config()
module.exports = {
// your usual config.
}
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Start development server using
npm run dev
Copyright (c) Nuxt Community