I’m working with an NPM package that uses optional chaining. It sounds like I need to configure webpack to be able to understand this syntax. I don’t see any information in the documentation on how to do this.
The package for reference is pdfjs-dist.
https://www.npmjs.com/package/pdfjs-dist
Error message for reference:
"stdout": "./node_modules/pdfjs-dist/build/pdf.mjs 402:14\nModule parse failed: Unexpected token (402:14)\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n| }\n| function _isValidProtocol(url) {\n> switch (url?.protocol) {\n| case \"http:\":\n| case \"https:\":\n @ ./src/index.ts 12:17-38",