How to import JSON files in ES modules

added by JavaScript Kicks
6/7/2021 12:50:28 PM

1700 Views

If you're using EcmaScript modules, you probably know the problem that you can't "just" import JSON files. To import and load a JSON file in an ES module, you have to do a "window.fetch dance" to request the file and parse it yourself. It's not great... But there's hope!


0 comments