git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit d393015f835e882e9ded1efb5f5b459f624ee943

extract into `simple-rc` module

Michael Williams committed on 1/2/2016, 1:22:09 PM
Parent: 2701b2aa389b3a8acde4ec8c6b2ffe3b13cc49a4

Files changed

app/config.jschanged
app/package.jsonchanged
app/config-browser.jsdeleted
config/defaults.jsdeleted
config/index.jsadded
package.jsonchanged
app/config.jsView
@@ -1,14 +1,1 @@
1-const { join } = require('path')
2-
3-const configDir = join(__dirname, '..', 'config')
4-const nodeEnv = process.env.NODE_ENV || 'development'
5-
6-const defaults = require(join(configDir, 'defaults'))
7-const envConfig = require(join(configDir, nodeEnv))
8-
9-const config = {
10- ...defaults,
11- ...envConfig
12-}
13-
14-module.exports = config
1+module.exports = require('simple-rc')()
app/package.jsonView
@@ -1,15 +1,19 @@
11 {
22 "browser": {
3- "./api.js": "./clients/index.js",
4- "./config.js": "./config-browser.js"
3+ "./api.js": "./clients/index.js"
54 },
65 "browserify": {
76 "transform": [
87 ["cssify", { "modules": true } ],
98 "babelify",
109 "envify",
11- ["evalify", { "files": [ "config-browser.js" ] } ],
1210 "bulkify"
1311 ]
12+ },
13+ "rc": {
14+ "files": [
15+ "../config/${NODE_ENV}",
16+ "../config"
17+ ]
1418 }
1519 }
app/config-browser.jsView
@@ -1,3 +1,0 @@
1-const config = require('./config')
2-
3-module.exports = config.browser
config/defaults.jsView
@@ -1,10 +1,0 @@
1-const { join } = require('path')
2-const env = process.env
3-const nodeEnv = env.NODE_ENV
4-
5-module.exports = {
6- static: {
7- root: join(__dirname, '..', 'build')
8- },
9- port: env.PORT || 5000
10-}
config/index.jsView
@@ -1,0 +1,10 @@
1+const join = require('path').join
2+const env = process.env
3+const nodeEnv = env.NODE_ENV
4+
5+module.exports = {
6+ static: {
7+ root: join(__dirname, '..', 'build')
8+ },
9+ port: env.PORT || 5000
10+}
package.jsonView
@@ -93,8 +93,9 @@
9393 "react-router": "^1.0.0",
9494 "redux": "^3.0.5",
9595 "redux-simple-router": "0.0.10",
9696 "redux-thunk": "^1.0.0",
97+ "simple-rc": "github:ahdinosaur/simple-rc",
9798 "serve-static": "^1.10.0",
9899 "uglifyify": "^3.0.1"
99100 }
100101 }

Built with git-ssb-web