From 654090b1b309543a10c2f15a9a7e16aaf7529a61 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Wed, 14 Aug 2024 11:42:18 +0100 Subject: [PATCH] Transpile PDF.js v4 with Babel (#19846) GitOrigin-RevId: 1338dbae0683d72ab84ee58d1128d22754d14567 --- services/web/babel.config.json | 1 + services/web/webpack.config.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/services/web/babel.config.json b/services/web/babel.config.json index 75c21e2cb2..e6e36f7f9f 100644 --- a/services/web/babel.config.json +++ b/services/web/babel.config.json @@ -1,4 +1,5 @@ { + "compact": false, "presets": [ [ "@babel/env", diff --git a/services/web/webpack.config.js b/services/web/webpack.config.js index 7cadbf5b9a..621c892c97 100644 --- a/services/web/webpack.config.js +++ b/services/web/webpack.config.js @@ -125,7 +125,10 @@ module.exports = { test: /\.([jt]sx?|[cm]js)$/, // Only compile application files and specific dependencies // (other npm and vendored dependencies must be in ES5 already) - exclude: [/node_modules\/(?!(react-dnd|chart\.js|@uppy)\/)/, vendorDir], + exclude: [ + /node_modules\/(?!(react-dnd|chart\.js|@uppy|pdfjs-dist401)\/)/, + vendorDir, + ], use: [ { loader: 'babel-loader',