Skip to content

Commit 8129173

Browse files
committed
chore: mention SSR externals upgrade tips
ref #1219
1 parent 646f44f commit 8129173

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: README.md

+19
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,25 @@ Works the same way as you'd configure it for normal CSS. Example usage with [min
233233
}
234234
```
235235

236+
## SSR externals
237+
238+
In SSR, we typically use `webpack-node-externals` to exclude npm dependencies from the server build. If you need to import CSS from an npm dependency, the previous solution was using a whitelist like this:
239+
240+
``` js
241+
// webpack config
242+
externals: nodeExternals({
243+
whitelist: /\.css$/
244+
})
245+
```
246+
247+
With v15, imports for `<style src="dep/foo.css">` now has resourceQuery strings appended at the end of the request, so you need to update the above to:
248+
249+
``` js
250+
externals: nodeExternals({
251+
whitelist: [/\.css$/, /\?vue&type=style/]
252+
})
253+
```
254+
236255
## Options Deprecation
237256

238257
The following options have been deprecated and should be configured using normal webpack module rules:

0 commit comments

Comments
 (0)