Skip to content

Commit 3a659c7

Browse files
authored
docs: avoid code in heading (#7372)
1 parent ec86d70 commit 3a659c7

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/content/api/module-methods.mdx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ contributors:
1313
- chenxsan
1414
- jamesgeorge007
1515
- WofWca
16+
- snitin315
1617
related:
1718
- title: CommonJS Wikipedia
1819
url: https://en.wikipedia.org/wiki/CommonJS
@@ -140,19 +141,19 @@ import(/* webpackIgnore: true */ 'ignored-module.js');
140141
new URL(/* webpackIgnore: true */ 'file1.css', import.meta.url);
141142
```
142143
143-
##### `webpackIgnore`
144+
##### webpackIgnore
144145
145146
Disables dynamic import parsing when set to `true`.
146147
147148
When using `import.meta.url`, it does not remain as-is; instead, it gets replaced based on the `baseURI`. For modules, it is replaced with `new URL("./", import.meta.url)`, and for other cases, it defaults to `document.baseURI`. This ensures that relative URLs work correctly, aligning with the base URL context.
148149
149150
W> Note that setting `webpackIgnore` to `true` opts out of code splitting.
150151
151-
##### `webpackChunkName`
152+
##### webpackChunkName
152153
153154
A name for the new chunk. Since webpack 2.6.0, the placeholders `[index]` and `[request]` are supported within the given string to an incremented number or the actual resolved filename respectively. Adding this comment will cause our separate chunk to be named [my-chunk-name].js instead of [id].js.
154155
155-
##### `webpackFetchPriority`
156+
##### webpackFetchPriority
156157
157158
<Badge text="5.87.0+" />
158159
@@ -165,7 +166,7 @@ import(
165166
);
166167
```
167168
168-
##### `webpackMode`
169+
##### webpackMode
169170
170171
Since webpack 2.6.0, different modes for resolving dynamic imports can be specified. The following options are supported:
171172
@@ -174,27 +175,27 @@ Since webpack 2.6.0, different modes for resolving dynamic imports can be specif
174175
- `'eager'`: Generates no extra chunk. All modules are included in the current chunk and no additional network requests are made. A `Promise` is still returned but is already resolved. In contrast to a static import, the module isn't executed until the call to `import()` is made.
175176
- `'weak'`: Tries to load the module if the module function has already been loaded in some other way (e.g. another chunk imported it or a script containing the module was loaded). A `Promise` is still returned, but only successfully resolves if the chunks are already on the client. If the module is not available, the `Promise` is rejected. A network request will never be performed. This is useful for universal rendering when required chunks are always manually served in initial requests (embedded within the page), but not in cases where app navigation will trigger an import not initially served.
176177
177-
##### `webpackPrefetch`
178+
##### webpackPrefetch
178179
179180
Tells the browser that the resource is probably needed for some navigation in the future. Check out the guide for more information on [how webpackPrefetch works](/guides/code-splitting/#prefetchingpreloading-modules).
180181
181-
##### `webpackPreload`
182+
##### webpackPreload
182183
183184
Tells the browser that the resource might be needed during the current navigation. Check out the guide for more information on [how webpackPreload works](/guides/code-splitting/#prefetchingpreloading-modules).
184185
185186
T> Note that all options can be combined like so `/* webpackMode: "lazy-once", webpackChunkName: "all-i18n-data" */`. This is wrapped in a JavaScript object and executed using [node VM](https://nodejs.org/dist/latest-v8.x/docs/api/vm.html). You do not need to add curly brackets.
186187
187-
##### `webpackInclude`
188+
##### webpackInclude
188189
189190
A regular expression that will be matched against during import resolution. Only modules that match **will be bundled**.
190191
191-
##### `webpackExclude`
192+
##### webpackExclude
192193
193194
A regular expression that will be matched against during import resolution. Any module that matches **will not be bundled**.
194195
195196
T> Note that `webpackInclude` and `webpackExclude` options do not interfere with the prefix. eg: `./locale`.
196197
197-
##### `webpackExports`
198+
##### webpackExports
198199
199200
Tells webpack to only bundle the specified exports of a dynamically `import()`ed module. It can decrease the output size of a chunk. Available since [webpack 5.0.0-beta.18](https://github.com/webpack/webpack/releases/tag/v5.0.0-beta.18).
200201

0 commit comments

Comments
 (0)