You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/content/configuration/module.mdx
+47
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ contributors:
23
23
- snitin315
24
24
- vabushkevich
25
25
- ahabhgk
26
+
- hai-x
26
27
---
27
28
28
29
These options determine how the [different types of modules](/concepts/modules) within a project will be treated.
@@ -705,6 +706,52 @@ The `'relative'` value for `module.parser.javascript.url` is available since web
705
706
1. This is useful for SSR (Server side rendering) when base URL is not known by server (and it saves a few bytes). To be identical it must also be used for the client build.
706
707
2. Also for static site generators, mini-css-plugin and html-plugin, etc. where server side rendering is commonly needed.
707
708
709
+
### module.parser.json
710
+
711
+
Configure options for json parser.
712
+
713
+
```js
714
+
module.exports= {
715
+
module: {
716
+
parser: {
717
+
json: {
718
+
// options
719
+
},
720
+
},
721
+
},
722
+
};
723
+
```
724
+
725
+
### module.parser.json.exportsDepth
726
+
727
+
The depth of json dependency flagged as `exportInfo`. By default, it is set to `Infinity` in production mode, and `1` in development mode.
728
+
729
+
- Type: `number`
730
+
- Available: <Badgetext='5.98.0+' />
731
+
- Example:
732
+
733
+
```js
734
+
module.exports= {
735
+
module: {
736
+
parser: {
737
+
json: {
738
+
// For example, for the following json
739
+
// {
740
+
// "depth_1": {
741
+
// "depth_2": {
742
+
// "depth_3": "foo"
743
+
// }
744
+
// },
745
+
// "_depth_1": "bar"
746
+
// }
747
+
// when `exportsDepth: 1`, `depth_2` and `depth_3` will not be flagged as `exportInfo`.
0 commit comments