diff --git a/lib/handlers.js b/lib/handlers.js index 4de6aa3..31870b4 100644 --- a/lib/handlers.js +++ b/lib/handlers.js @@ -77,6 +77,8 @@ export default class Handlers { let shorty = Shortstop.create(); shorty.use('import', function (file, cb) { + //check for json extension + file = (/\.json$/.test(file)) ? file : `${file}.json`; try { file = path(file); return shorty.resolve(loadJsonicSync(file), cb); diff --git a/test/fixtures/import/child.json b/test/fixtures/import/child.json index f84f305..b270a1b 100644 --- a/test/fixtures/import/child.json +++ b/test/fixtures/import/child.json @@ -1,4 +1,4 @@ { "name": "child", - "grandchild": "import:./grandchild.json" + "grandchild": "import:./grandchild" } \ No newline at end of file