0.0.15 • Published 5 years ago
nuxt-configuration v0.0.15
nuxt-configuration
A nuxt.js module that allows us to load multiple configuration files
Features
The module loads configurations files.
Setup
- 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 */ }]
]
}
Using top level options
{
modules: [
'nuxt-configuration'
],
dotenv: {
/* module options */
}
}
Options
TODO explains options...
Usage
After creating your config files, simply run your usual yarn dev
or npm run dev
.
You can use this.$config in your components
Using .env file in configuration files
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.
}
Development
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Start development server using
npm run dev
License
Copyright (c) Nuxt Community