Skip to content

Commit 46c1375

Browse files
committed
Add asset/source configuration for pdf.worker.min.mjs in webpack config
1 parent 6484a18 commit 46c1375

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

example/webpack.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ module.exports = {
4444
},
4545
// We are importing this worker as a string by using asset/source otherwise it will default to loading via an HTTPS request later.
4646
// This causes issues if we have gone offline before the pdfjs web worker is set up as we won't be able to load it from the server.
47+
{
48+
// eslint-disable-next-line prefer-regex-literals
49+
test: new RegExp('node_modules/pdfjs-dist/build/pdf.worker.min.mjs'),
50+
type: 'asset/source',
51+
},
4752
{
4853
// eslint-disable-next-line prefer-regex-literals
4954
test: new RegExp('node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs'),

0 commit comments

Comments
 (0)