Skip to content

Commit

Permalink
address Spencer's comment p.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Mar 20, 2020
1 parent 3021e43 commit 59759d7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/kbn-optimizer/src/worker/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/',
Expand All @@ -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',
Expand Down

0 comments on commit 59759d7

Please sign in to comment.