小程序npm包json引用怎么破,默认不支持json依赖!

https://img2.mukewang.com/5b78e0f400018a0a08000255.jpg

VM16832:1 thirdScriptError 
 sdk uncaught third Error 
 module "npm/entities/maps/xml.json.js" is not defined 
 Error: module "npm/entities/maps/xml.json.js" is not defined
    at require (http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7213)
    at http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7068
    at http://127.0.0.1:33642/appservice/npm/entities/lib/encode.js:1:470
    at require (http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7354)
    at http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7068
    at http://127.0.0.1:33642/appservice/npm/entities/index.js:1:447
    at require (http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7354)
    at http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7068
    at http://127.0.0.1:33642/appservice/npm/basic-xml2json/lib/index.js:5:16
    at require (http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7354)


FFIVE
浏览 1394回答 2
2回答

蛊毒传说

把你的.json 搞成 .js{ "a" : 1}改成:module.exports = {  a : 1}
打开App,查看更多内容
随时随地看视频慕课网APP