Skip to content

Commit

Permalink
fix: Resolving es default standards
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsteele committed May 4, 2017
1 parent 867da3f commit 9368f72
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict'

let JSONTruncate
try {
JSONTruncate = require('./dist/json-truncate').default
} catch (err) {
if (err.code === 'MODULE_NOT_FOUND') {
require('babel-register')
JSONTruncate = require('./src/json-truncate').default
} else {
console.log(err)
process.exit(1)
}
}

module.exports = JSONTruncate
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "json-truncate",
"version": "0.0.0-semantically-released",
"description": "A way to truncate a json object.",
"main": "dist/json-truncate.js",
"main": "index.js",
"scripts": {
"precommit": "npm run lint && npm run coverage",
"commit": "git-cz",
Expand Down

0 comments on commit 9368f72

Please sign in to comment.