From 3dc1bd5caefb0355508880b507528d85d8eff2ae Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 4 Nov 2023 12:57:57 +0100 Subject: [PATCH] Update `external/dist/webpack.mjs` to account for outputting of JavaScript modules (PR 17055 follow-up) Hopefully this makes sense, since I don't know enough about Webpack to tell exactly how this file is being used in practice. --- external/dist/{webpack.js => webpack.mjs} | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) rename external/dist/{webpack.js => webpack.mjs} (80%) diff --git a/external/dist/webpack.js b/external/dist/webpack.mjs similarity index 80% rename from external/dist/webpack.js rename to external/dist/webpack.mjs index ec6546cb03ca97..07396966299f43 100644 --- a/external/dist/webpack.js +++ b/external/dist/webpack.mjs @@ -12,17 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* eslint-disable import/no-commonjs */ +/* eslint-disable import/no-unresolved */ -"use strict"; - -const pdfjs = require("./build/pdf.mjs"); +import { GlobalWorkerOptions } from "./build/pdf.mjs"; if (typeof window !== "undefined" && "Worker" in window) { - pdfjs.GlobalWorkerOptions.workerPort = new Worker( + GlobalWorkerOptions.workerPort = new Worker( new URL("./build/pdf.worker.mjs", import.meta.url), { type: "module" } ); } -module.exports = pdfjs; +export * from "./build/pdf.mjs";