Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8129173

Browse filesBrowse files
committed
chore: mention SSR externals upgrade tips
ref vuejs#1219
1 parent 646f44f commit 8129173
Copy full SHA for 8129173

File tree

Expand file treeCollapse file tree

1 file changed

+19
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-0
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+19Lines changed: 19 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.