mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #7100 from overleaf/ae-worker-hash
Improve webpack config for Web Worker scripts GitOrigin-RevId: 38773291726d31cc31a8360049db67103198582b
This commit is contained in:
parent
29aa7c622a
commit
bd74a149ce
1 changed files with 3 additions and 15 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue