Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit b92cadc

Browse files
committed
Docs for filtering files
1 parent 89450d8 commit b92cadc

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,25 @@ will inject just this:
126126
<link rel="preload" href="home.31132ae6680e598f8879.js" as="script">
127127
```
128128

129+
Filtering chunks
130+
---------------------
131+
132+
There may be chunks that you don't want to have preloaded (sourcemaps, for example). Before preloading each chunk, this plugin checks that the file does not match any regex in the `fileBlacklist` option. The default value of this blacklist is `[/\.map/]`, meaning no sourcemaps will be preloaded. You can easily override this:
133+
134+
```js
135+
new PreloadWebpackPlugin({
136+
fileBlacklist: [/\.whatever/]
137+
})
138+
```
139+
140+
Passing your own array will override the default, so if you want to continue filtering sourcemaps along with your own custom settings, you'll need to include the regex for sourcemaps:
141+
142+
```js
143+
new PreloadWebpackPlugin({
144+
fileBlacklist: [/\.map./, /\.whatever/]
145+
})
146+
```
147+
129148
Resource Hints
130149
---------------------
131150

0 commit comments

Comments
 (0)