From 5722c0b0178ec72ca490604265063f787eec6764 Mon Sep 17 00:00:00 2001 From: Alex Szabo Date: Wed, 30 Oct 2024 14:37:30 +0100 Subject: [PATCH] process launchdarkly imports - required since launchdarkly-js-client-sdk includes a ?. in their cjs bundle --- packages/kbn-optimizer/src/worker/webpack.config.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts index 96a17a6ae7229..b5da9566878e1 100644 --- a/packages/kbn-optimizer/src/worker/webpack.config.ts +++ b/packages/kbn-optimizer/src/worker/webpack.config.ts @@ -280,6 +280,14 @@ export function getWebpackConfig( plugins: ['@babel/plugin-transform-logical-assignment-operators'], }, }, + { + test: /node_modules[\/\\]launchdarkly[^\/\\]+[\/\\].*.js$/, + loaders: 'babel-loader', + options: { + envName: worker.dist ? 'production' : 'development', + presets: [BABEL_PRESET], + }, + }, { test: /\.(html|md|txt|tmpl)$/, use: {