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: {