Bug: Add @rollup/plugin-json to import JSON files
dan-cooke opened this issue · comments
Daniel Cooke commented
The example rollup.config.js
imports the package.json
Not sure if this is a new requirement from rollup. But this is seemingly not possible without adding @rollup/plugin-json
.
Heres the error:
Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files)
../../node_modules/iconv-lite/encodings/tables/gb18030-ranges.json (1:9)
1: {"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8
Daniel Cooke commented
Ok this looks like an issue with rollup itself.
Seemingly using JSON.parse
in the file you are bundling - causes this error to be thrown... hmm