In Webpack 5, the [recommended way](https://webpack.js.org/guides/web-workers/) to create a web worker is

```ts
new Worker(new URL('./worker.js', import.meta.url));
```

Could we update\* the [`pdfjs-dist/webpack` entrypoint](https://github.com/mozilla/pdfjs-dist/blob/master/webpack.js) to use this syntax instead of the legacy `worker-loader`? One of the Webpack contributors told me that `worker-loader` uses "magic" and can cause issues.

\* To maintain compatibility with people still using Webpack 4, we should probably introduce a new entrypoint called `pdfjs-dist/webpack5` (or something like that) rather than changing the existing entrypoint.

Can attempt a PR if you would like.

Closely-related: https://github.com/mozilla/pdf.js/issues/15302


const fs = require("fs");
const gulp = require("gulp");
const postcss = require("gulp-postcss");
const rename = require("gulp-rename");
const replace = require("gulp-replace");
const mkdirp = require("mkdirp");
const path = require("path");
const rimraf = require("rimraf");
const stream = require("stream");
const exec = require("child_process").exec;
const spawn = require("child_process").spawn;
const spawnSync = require("child_process").spawnSync;
const streamqueue = require("streamqueue");
const merge = require("merge-stream");
const zip = require("gulp-zip");
const webpack2 = require("webpack");
const webpackStream = require("webpack-stream");
const Vinyl = require("vinyl");
const vfs = require("vinyl-fs");
const through = require("through2");
const BUILD_DIR = "build/";
const L10N_DIR = "l10n/";
const TEST_DIR = "test/";
const EXTENSION_SRC_DIR = "extensions/";
const BASELINE_DIR = BUILD_DIR + "baseline/";
const MOZCENTRAL_BASELINE_DIR = BUILD_DIR + "mozcentral.baseline/";
const GENERIC_DIR = BUILD_DIR + "generic/";
const GENERIC_LEGACY_DIR = BUILD_DIR + "generic-legacy/";
const COMPONENTS_DIR = BUILD_DIR + "components/";
const COMPONENTS_LEGACY_DIR = BUILD_DIR + "components-legacy/";