diff --git a/src/content/api/module-methods.mdx b/src/content/api/module-methods.mdx index d633082f2a6c..87ccd282838c 100644 --- a/src/content/api/module-methods.mdx +++ b/src/content/api/module-methods.mdx @@ -136,12 +136,16 @@ import( ```js import(/* webpackIgnore: true */ 'ignored-module.js'); + +new URL(/* webpackIgnore: true */ 'file1.css', import.meta.url); ``` ##### `webpackIgnore` Disables dynamic import parsing when set to `true`. +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. + W> Note that setting `webpackIgnore` to `true` opts out of code splitting. ##### `webpackChunkName`