Skip to content

Commit

Permalink
parse config files which have comments!
Browse files Browse the repository at this point in the history
  • Loading branch information
mixmix committed May 16, 2019
1 parent 489c662 commit bc4894c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const nest = require('depnest')
const fs = require('fs')
const { join } = require('path')
const { get, cloneDeep, isEqual } = require('lodash')
const JSON5 = require('json5')

// This is needed to over-ride config.sync.load in patchcore.
// By baking a fresh module with the config inside it,
Expand Down Expand Up @@ -54,7 +55,7 @@ function configModule (config) {
join(config.path, 'config'),
'utf8'
)
return JSON.parse(str)
return JSON5.parse(str) // will read around comments
} catch (e) {
return {}
}
Expand Down

0 comments on commit bc4894c

Please sign in to comment.