mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 13:49:00 +02: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user