Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

nuxt-json-config

Djancyp2MIT0.0.2

config module for nuxt

nuxtjs, nuxt, config, json config

readme

JSON CONFIG FOR NUXT

This module allows you to have Node config package into nuxtjs.

Installation

Use the package manager pip to install foobar.

npm i nuxt-json-config

Usage

1- Create config folder and config json file on root dir.

$ mkdir config
$ vi config/default.json

2- Edit config as you wish

{
  "server":{
    "host":"http://localhost:3000",
    "example":"/api/ex"
 }
}

3- Register module in nuxt.config.js

  modules: [
    'nuxt-json-config'
  ],

4- yarn dev and start the project

in components, you can access all config by

this.$config

example:

mounted(){
  console.log(this.$config.server.host)
}

License

MIT