0.13.0 • Published 3 years ago
fc-config v0.13.0
fc-config
Installation
# Use npm
npm install fc-config
# Or use yarn
yarn add fc-configPrepare
Create config/default.js
module.exports = {
Env: 'It will be rewritten by process.env.NODE_CONFIG_ENV or process.env.NODE_ENV',
prop1: 123,
prop2: 'abc',
……
}Usage
import { GlobalAppConfig } from 'fc-config'
...Tips
Env's default value isdevelopment./config/${env}.jswill be theEnvConfigFileprocess.env.NODE_CONFIG_EXTRA_JSwill be theExtrasConfigFile, it should use absolute-pathprocess.env.ENV_CONFIG_DATAwill be theRuntimeConfig, it should be a JSON-string.- Merge Priority:
RuntimeConfig>ExtrasConfigFile>EnvConfigFile>default.js