mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
jsonminify to strip-json-comments
This commit is contained in:
parent
951c0dc906
commit
f75043178f
@ -17,7 +17,7 @@
|
||||
|
||||
var nodePath = require('path');
|
||||
var fs = require('fs');
|
||||
var jsonminify = require('jsonminify');
|
||||
var stripJsonComments = require('strip-json-comments');
|
||||
var tagDefFromCode = require('./tag-def-from-code');
|
||||
var loader = require('./loader');
|
||||
var fsReadOptions = { encoding: 'utf8' };
|
||||
@ -109,7 +109,7 @@ module.exports = function scanTagsDir(tagsConfigPath, tagsConfigDirname, dir, ta
|
||||
hasTagFile = true;
|
||||
// marko-tag.json exists in the directory, use that as the tag definition
|
||||
try {
|
||||
tagDef = JSON.parse(jsonminify(fs.readFileSync(tagFile, fsReadOptions)));
|
||||
tagDef = JSON.parse(stripJsonComments(fs.readFileSync(tagFile, fsReadOptions)));
|
||||
} catch(e) {
|
||||
throw new Error('Unable to parse JSON file at path "' + tagFile + '". Error: ' + e);
|
||||
}
|
||||
|
||||
@ -15,16 +15,16 @@
|
||||
*/
|
||||
|
||||
var fs = require('fs');
|
||||
var jsonminify = require('jsonminify');
|
||||
var stripJsonComments = require('strip-json-comments');
|
||||
var fsReadOptions = { encoding: 'utf8' };
|
||||
|
||||
exports.readTaglib = function (path) {
|
||||
var json = fs.readFileSync(path, fsReadOptions);
|
||||
|
||||
try {
|
||||
var taglibProps = JSON.parse(jsonminify(json));
|
||||
var taglibProps = JSON.parse(stripJsonComments(json));
|
||||
return taglibProps;
|
||||
} catch(e) {
|
||||
throw new Error('Unable to parse taglib at path "' + path + '". Error: ' + e);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -31,7 +31,6 @@
|
||||
"esprima": "^2.7.0",
|
||||
"events": "^1.0.2",
|
||||
"htmljs-parser": "^1.5.3",
|
||||
"jsonminify": "^0.2.3",
|
||||
"lasso-package-root": "^1.0.0",
|
||||
"minimatch": "^0.2.14",
|
||||
"property-handlers": "^1.0.0",
|
||||
@ -45,6 +44,7 @@
|
||||
"raptor-strings": "^1.0.0",
|
||||
"raptor-util": "^1.0.0",
|
||||
"resolve-from": "^1.0.0",
|
||||
"strip-json-comments": "^2.0.1",
|
||||
"try-require": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user