From bd74a149cea5b98f28a001e52bb5bbaa63321cab Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Thu, 17 Mar 2022 11:00:06 +0000 Subject: [PATCH] Merge pull request #7100 from overleaf/ae-worker-hash Improve webpack config for Web Worker scripts GitOrigin-RevId: 38773291726d31cc31a8360049db67103198582b --- services/web/webpack.config.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/services/web/webpack.config.js b/services/web/webpack.config.js index ff73c17014..575b94bce6 100644 --- a/services/web/webpack.config.js +++ b/services/web/webpack.config.js @@ -101,15 +101,15 @@ module.exports = { ], }, { - // Wrap PDF.js worker in a Web Worker - test: /pdf\.worker\.js$/, + // Wrap worker scripts in a Web Worker + test: /\.worker\.js$/, use: [ { loader: 'worker-loader', options: { // Write into js directory (note: customising this is not possible // with pdfjs-dist/webpack auto loader) - name: 'js/pdfjs-worker.[hash].js', + name: 'js/[name].[contenthash].js', // Override dynamically-set publicPath to explicitly use root. // This prevents a security problem where the Worker - normally // loaded from a CDN - has cross-origin issues, by forcing it to not @@ -130,18 +130,6 @@ module.exports = { }, ], }, - { - test: /latex-linter.worker.js$/, - use: [ - { - loader: 'worker-loader', - options: { - name: 'js/latex-linter.worker.js', - publicPath: '/', - }, - }, - ], - }, { // Pass Less files through less-loader/css-loader/mini-css-extract- // plugin (note: run in reverse order)