Update external/dist/webpack.js 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.
This commit is contained in:
Jonas Jenwald 2023-11-04 12:57:57 +01:00
parent 9eb9d3f949
commit 13ca668be0

View File

@ -12,17 +12,15 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable import/no-commonjs */ /* eslint-disable import/no-unresolved */
"use strict"; import { GlobalWorkerOptions } from "./build/pdf.mjs";
const pdfjs = require("./build/pdf.mjs");
if (typeof window !== "undefined" && "Worker" in window) { 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), new URL("./build/pdf.worker.mjs", import.meta.url),
{ type: "module" } { type: "module" }
); );
} }
module.exports = pdfjs; export * from "./build/pdf.mjs";