Strip out comments before parsing babelrc
This commit is contained in:
parent
24fced406e
commit
e88c28f88b
@ -53,6 +53,7 @@
|
||||
"slash": "^1.0.0",
|
||||
"source-map": "^0.4.0",
|
||||
"source-map-support": "^0.2.9",
|
||||
"strip-json-comments": "^1.0.2",
|
||||
"to-fast-properties": "^1.0.0",
|
||||
"trim-right": "^1.0.0"
|
||||
},
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import stripJsonComments from "strip-json-comments";
|
||||
import merge from "lodash/object/merge";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
@ -24,7 +25,7 @@ export default function (loc, opts = {}) {
|
||||
var json;
|
||||
|
||||
try {
|
||||
json = jsons[content] ||= JSON.parse(content);
|
||||
json = jsons[content] ||= JSON.parse(stripJsonComments(content));
|
||||
} catch (err) {
|
||||
err.message = `${file}: ${err.message}`;
|
||||
throw err;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user