From fefa61a11f2d769842e9bb516e57349f61e62fe4 Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Mon, 24 Jun 2019 21:24:33 +0300 Subject: [PATCH] docs(guides) mention that only default export will work for json in webpack 5 --- src/content/guides/asset-management.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/content/guides/asset-management.md b/src/content/guides/asset-management.md index aaf85b1849e2..4512f423b753 100644 --- a/src/content/guides/asset-management.md +++ b/src/content/guides/asset-management.md @@ -472,6 +472,16 @@ When you open `index.html` and look at your console in your developer tools, you T> This can be especially helpful when implementing some sort of data visualization using a tool like [d3](https://github.com/d3). Instead of making an ajax request and parsing the data at runtime you can load it into your module during the build process so that the parsed data is ready to go as soon as the module hits the browser. +W> Only the default export of JSON modules can be used without warning. + +```javascript +// No warning +import data from './data.json' + +// Warning shown, this is not allowed by the spec. +import { foo } from './data.json' +``` + ## Global Assets