rollup-plugin-json
Advanced tools
Comparing version 2.2.0 to 2.3.0
# rollup-plugin-json changelog | ||
## 2.3.0 | ||
* Always parse JSON, so malformed JSON is identified at bundle time ([#27](https://github.com/rollup/rollup-plugin-json/issues/27)) | ||
## 2.2.0 | ||
@@ -4,0 +8,0 @@ |
@@ -17,6 +17,5 @@ 'use strict'; | ||
var data = JSON.parse(json); | ||
var code = ''; | ||
// Manipulating properties so keeping as `let` | ||
// eslint-disable-next-line prefer-const | ||
var ast = { | ||
@@ -30,3 +29,3 @@ type: 'Program', | ||
if (json[0] !== '{') { | ||
if (Object.prototype.toString.call(data) !== '[object Object]') { | ||
code = "export default " + json + ";"; | ||
@@ -47,3 +46,2 @@ | ||
} else { | ||
var data = JSON.parse(json); | ||
var indent = 'indent' in options ? options.indent : '\t'; | ||
@@ -50,0 +48,0 @@ |
@@ -15,6 +15,5 @@ import { createFilter, makeLegalIdentifier } from 'rollup-pluginutils'; | ||
var data = JSON.parse(json); | ||
var code = ''; | ||
// Manipulating properties so keeping as `let` | ||
// eslint-disable-next-line prefer-const | ||
var ast = { | ||
@@ -28,3 +27,3 @@ type: 'Program', | ||
if (json[0] !== '{') { | ||
if (Object.prototype.toString.call(data) !== '[object Object]') { | ||
code = "export default " + json + ";"; | ||
@@ -45,3 +44,2 @@ | ||
} else { | ||
var data = JSON.parse(json); | ||
var indent = 'indent' in options ? options.indent : '\t'; | ||
@@ -48,0 +46,0 @@ |
{ | ||
"name": "rollup-plugin-json", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"main": "dist/rollup-plugin-json.cjs.js", | ||
@@ -11,5 +11,5 @@ "module": "dist/rollup-plugin-json.es.js", | ||
"mocha": "^3.0.2", | ||
"rollup": "^0.37.0", | ||
"rollup": "^0.41.6", | ||
"rollup-plugin-buble": "^0.15.0", | ||
"rollup-plugin-node-resolve": "^2.0.0", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"source-map-support": "^0.4.2" | ||
@@ -33,4 +33,4 @@ }, | ||
"dependencies": { | ||
"rollup-pluginutils": "^1.5.2" | ||
"rollup-pluginutils": "^2.0.1" | ||
} | ||
} |
@@ -13,7 +13,6 @@ import { createFilter, makeLegalIdentifier } from 'rollup-pluginutils'; | ||
const data = JSON.parse(json); | ||
let code = ''; | ||
// Manipulating properties so keeping as `let` | ||
// eslint-disable-next-line prefer-const | ||
let ast = { | ||
const ast = { | ||
type: 'Program', | ||
@@ -26,3 +25,3 @@ sourceType: 'module', | ||
if (json[0] !== '{') { | ||
if (Object.prototype.toString.call(data) !== '[object Object]') { | ||
code = `export default ${json};`; | ||
@@ -43,3 +42,2 @@ | ||
} else { | ||
const data = JSON.parse(json); | ||
const indent = 'indent' in options ? options.indent : '\t'; | ||
@@ -46,0 +44,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
34304
442
+ Addedestree-walker@0.6.1(transitive)
+ Addedrollup-pluginutils@2.8.2(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedestree-walker@0.2.1(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedrollup-pluginutils@1.5.2(transitive)
Updatedrollup-pluginutils@^2.0.1