From 39a88d24c7d32e5e17f3741266226525fe6363d8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 21 Feb 2023 14:20:15 +0100 Subject: Fix embed build with old web browsers --- client/webpack/webpack.video-embed.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'client/webpack') diff --git a/client/webpack/webpack.video-embed.js b/client/webpack/webpack.video-embed.js index 3f2805192..120eedade 100644 --- a/client/webpack/webpack.video-embed.js +++ b/client/webpack/webpack.video-embed.js @@ -68,6 +68,8 @@ module.exports = function () { { test: /\.ts$/, use: [ + getBabelLoader(), + { loader: 'ts-loader', options: { @@ -78,20 +80,7 @@ module.exports = function () { }, { test: /\.m?js$/, - use: [ - { - loader: 'babel-loader', - options: { - presets: [ - [ - '@babel/preset-env', { - targets: 'last 1 Chrome version, last 2 Edge major versions, Firefox ESR, Safari >= 11, ios_saf >= 11' - } - ] - ] - } - } - ] + use: [ getBabelLoader() ] }, { @@ -217,3 +206,18 @@ module.exports = function () { return configuration } + +function getBabelLoader () { + return { + loader: 'babel-loader', + options: { + presets: [ + [ + '@babel/preset-env', { + targets: 'last 1 Chrome version, last 2 Edge major versions, Firefox ESR, Safari >= 11, ios_saf >= 11' + } + ] + ] + } + } +} -- cgit v1.2.3