Skip to content

Commit 4445006

Browse files
committed
Improve documentation
1 parent e2f942c commit 4445006

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

guide/src/reference/cli.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,16 @@ Don't add WebAssembly fallback imports in generated JavaScript.
107107

108108
### `--split-linked-modules`
109109

110-
Controls whether wasm-bindgen will split linked modules out into their own files.
111-
Enabling this is recommended, because it allows lazy loading and setting a
112-
stricter Content Security Policy.
113-
114-
wasm-bindgen uses the `new URL('…', import.meta.url)` syntax to link such split
115-
out files. This is directly supported when using webpack 5 or no bundler at all.
116-
117-
For other bundlers, ensure they support the link syntax, possibly by enabling an
118-
extra plugin. That's why this option is disabled by default. Alternatively,
119-
configure the bundler to keep the link syntax as is and to copy all files in
120-
`snippets/` to the output directory preserving their paths.
110+
Controls whether wasm-bindgen will split linked modules out into their own
111+
files. Enabling this is recommended, because it allows lazy-loading the linked
112+
modules and setting a stricter Content Security Policy.
113+
114+
wasm-bindgen uses the `new URL('…', import.meta.url)` syntax to resolve the
115+
links to such split out files. This breaks with most bundlers, since the
116+
bundler doesn't know to include the linked module in its output. That's why
117+
this option is disabled by default. Webpack 5 is an exception, which has
118+
special treatment for that syntax. For other bundlers, you'll need to take
119+
extra steps to get it to work, likely by using a plugin. Alternatively, you can
120+
leave the syntax as is and instead manually configure the bundler to copy all
121+
files in `snippets/` to the output directory, preserving their paths relative
122+
to whichever bundled file ends up containing the JS shim.

0 commit comments

Comments
 (0)