From 62d0354fe09df348c665c813dffb273de4542929 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Tue, 14 Feb 2023 23:01:00 +0300 Subject: [PATCH 1/2] Simplify adding modules to babel-loader --- webpack.common.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index fb0db8f0a5..700641b8af 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -96,7 +96,17 @@ module.exports = { }, { test: /\.(js|jsx)$/, - exclude: /node_modules[\\/](?!@uupaa[\\/]dynamic-import-polyfill|blurhash|date-fns|epubjs|flv.js|libarchive.js|marked|screenfull)/, + include: [ + path.resolve(__dirname, 'node_modules/@uupaa/dynamic-import-polyfill'), + path.resolve(__dirname, 'node_modules/blurhash'), + path.resolve(__dirname, 'node_modules/date-fns'), + path.resolve(__dirname, 'node_modules/epubjs'), + path.resolve(__dirname, 'node_modules/flv.js'), + path.resolve(__dirname, 'node_modules/libarchive.js'), + path.resolve(__dirname, 'node_modules/marked'), + path.resolve(__dirname, 'node_modules/screenfull'), + path.resolve(__dirname, 'src') + ], use: [{ loader: 'babel-loader' }] @@ -118,7 +128,11 @@ module.exports = { }, /* modules that Babel breaks when transforming to ESM */ { - test: /node_modules[\\/](pdfjs-dist|xmldom)[\\/].*\.js$/, + test: /\.js$/, + include: [ + path.resolve(__dirname, 'node_modules/pdfjs-dist'), + path.resolve(__dirname, 'node_modules/xmldom') + ], use: [{ loader: 'babel-loader', options: { From 38aebf4e42cb1d1df3b6882ab31770b3961faa70 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Tue, 14 Feb 2023 23:01:30 +0300 Subject: [PATCH 2/2] Babelify @jellyfin/libass-wasm --- webpack.common.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webpack.common.js b/webpack.common.js index 700641b8af..be26a840cb 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -97,6 +97,7 @@ module.exports = { { test: /\.(js|jsx)$/, include: [ + path.resolve(__dirname, 'node_modules/@jellyfin/libass-wasm'), path.resolve(__dirname, 'node_modules/@uupaa/dynamic-import-polyfill'), path.resolve(__dirname, 'node_modules/blurhash'), path.resolve(__dirname, 'node_modules/date-fns'),