From 59759d7ad065d97d30fd9defd71d01ca76584f9e Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Fri, 20 Mar 2020 10:39:22 +0100 Subject: [PATCH] address Spencer's comment p.2 --- packages/kbn-optimizer/src/worker/webpack.config.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts index 1c56c0c6bebce..dabfed7f9725c 100644 --- a/packages/kbn-optimizer/src/worker/webpack.config.ts +++ b/packages/kbn-optimizer/src/worker/webpack.config.ts @@ -131,14 +131,12 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) { loader: 'resolve-url-loader', options: { join: (_: string, __: any) => (uri: string, base?: string) => { - if (!base) { + // apply only to legacy platform styles + if (!base || !parseDirPath(base).dirs.includes('legacy')) { return null; } - if ( - uri.startsWith('ui/assets') && - parseDirPath(base).dirs.includes('legacy') - ) { + if (uri.startsWith('ui/assets')) { return Path.resolve( worker.repoRoot, 'src/core/server/core_app/', @@ -147,7 +145,7 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) { } // manually force ui/* urls in legacy styles to resolve to ui/legacy/public - if (uri.startsWith('ui/') && parseDirPath(base).dirs.includes('legacy')) { + if (uri.startsWith('ui/')) { return Path.resolve( worker.repoRoot, 'src/legacy/ui/public',