Skip to content

Commit ffb751c

Browse files
committed
Feat: Always use config_production and ignore NODE_ENV if the module is in /node_modules, Feat: Adds .npmignore for npm publish
1 parent a79f0d4 commit ffb751c

File tree

18 files changed

+275
-171
lines changed

18 files changed

+275
-171
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ build/Release
5656
node_modules/
5757
jspm_packages/
5858

59+
# exception for the test cases
60+
!test/data/node_modules
5961

6062
# Typescript v1 declaration files
6163
typings/

.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
### ConfigComponent ###
3+
4+
### NPM Publish ###
5+
6+
.idea
7+
test/

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Node-config-component
2+
3+
Heavily inspired by Symphony Config-component.
4+
5+
Main features:
6+
- Yaml config
7+
- Convention over configuration
8+
- production first
9+
- Respect of the "twelve factors app"
10+
11+
With node-config-component, create your module configuration with ease thanks to cascading config files and target imports.

configComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function _getFullConfig (module) {
4646
fileEnv = utils.getEnv();
4747
config = configComponent.loadSync(filePath);
4848
} catch (err) {
49-
49+
console.log(err)
5050
if (err.code !== 'ENOENT' || fileEnv === 'production') {
5151
// Unexpected Error or production config not found.
5252
throw err;

0 commit comments

Comments
 (0)