From 86a39c7569a12679f7a64123339426f3aac755c5 Mon Sep 17 00:00:00 2001 From: Val Gorodnichev Date: Thu, 29 Aug 2024 09:03:47 -0600 Subject: [PATCH 1/5] fix: more vite.config cleanups --- packages/analytics/analytics-chart/vite.config.ts | 10 ---------- packages/analytics/analytics-geo-map/vite.config.ts | 4 ++-- .../analytics/analytics-metric-provider/vite.config.ts | 3 +-- packages/entities/entities-routes/vite.config.ts | 8 ++++++++ 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/packages/analytics/analytics-chart/vite.config.ts b/packages/analytics/analytics-chart/vite.config.ts index a0608ec243..758163de54 100644 --- a/packages/analytics/analytics-chart/vite.config.ts +++ b/packages/analytics/analytics-chart/vite.config.ts @@ -16,16 +16,6 @@ const config = mergeConfig(sharedViteConfig, defineConfig({ entry: resolve(__dirname, './src/index.ts'), fileName: (format) => `${sanitizedPackageName}.${format}.js`, }, - rollupOptions: { - // Make sure to externalize deps that shouldn't be bundled into your library - external: ['@kong-ui-public/i18n'], - output: { - // Provide global variables to use in the UMD build for externalized deps - globals: { - '@kong-ui-public/i18n': 'kong-ui-public-i18n', - }, - }, - }, }, server: { open: true, diff --git a/packages/analytics/analytics-geo-map/vite.config.ts b/packages/analytics/analytics-geo-map/vite.config.ts index 3f3fb9266e..48b949fc57 100644 --- a/packages/analytics/analytics-geo-map/vite.config.ts +++ b/packages/analytics/analytics-geo-map/vite.config.ts @@ -18,11 +18,11 @@ const config = mergeConfig(sharedViteConfig, defineConfig({ }, rollupOptions: { // Make sure to externalize deps that shouldn't be bundled into your library - external: ['maplibre-gl', '@kong-ui-public/i18n'], + external: ['maplibre-gl'], output: { // Provide global variables to use in the UMD build for externalized deps globals: { - '@kong-ui-public/i18n': 'kong-ui-public-i18n', + 'maplibre-gl': 'maplibre-gl', }, }, }, diff --git a/packages/analytics/analytics-metric-provider/vite.config.ts b/packages/analytics/analytics-metric-provider/vite.config.ts index 9a7b3fd460..f1555f4c0e 100644 --- a/packages/analytics/analytics-metric-provider/vite.config.ts +++ b/packages/analytics/analytics-metric-provider/vite.config.ts @@ -19,7 +19,6 @@ const config = mergeConfig(sharedViteConfig, defineConfig({ rollupOptions: { // Make sure to externalize deps that shouldn't be bundled into your library external: [ - '@kong-ui-public/i18n', '@kong-ui-public/analytics-config-store', '@kong-ui-public/analytics-utilities', '@kong-ui-public/metric-cards', @@ -28,9 +27,9 @@ const config = mergeConfig(sharedViteConfig, defineConfig({ output: { // Provide global variables to use in the UMD build for externalized deps globals: { - '@kong-ui-public/i18n': 'kong-ui-public-i18n', '@kong-ui-public/analytics-config-store': 'kong-ui-public-analytics-config-store', '@kong-ui-public/analytics-utilities': 'kong-ui-public-analytics-utilities', + '@kong-ui-public/metric-cards': '@kong-ui-public/metric-cards', pinia: 'pinia', }, }, diff --git a/packages/entities/entities-routes/vite.config.ts b/packages/entities/entities-routes/vite.config.ts index 3db8a7fdc4..5b234a8b23 100644 --- a/packages/entities/entities-routes/vite.config.ts +++ b/packages/entities/entities-routes/vite.config.ts @@ -23,6 +23,14 @@ const config = mergeConfig(sharedViteConfig, defineConfig({ '@kong-ui-public/expressions/dist/style.css', 'lodash.isequal', ], + output: { + // Provide global variables to use in the UMD build for externalized deps + globals: { + '@kong-ui-public/expressions': '@kong-ui-public/expressions', + '@kong-ui-public/expressions/dist/style.css': '@kong-ui-public/expressions/dist/style.css', + 'lodash.isequal': 'lodash.isequal', + }, + }, }, }, ...(process.env.USE_SANDBOX From 79557f541d6b758e2107d2125f32b0068cafa713 Mon Sep 17 00:00:00 2001 From: ValeryG Date: Thu, 29 Aug 2024 09:36:51 -0600 Subject: [PATCH 2/5] Update packages/entities/entities-routes/vite.config.ts Co-authored-by: Adam DeHaven <2229946+adamdehaven@users.noreply.github.com> --- packages/entities/entities-routes/vite.config.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/entities/entities-routes/vite.config.ts b/packages/entities/entities-routes/vite.config.ts index 5b234a8b23..e1cbd1e50a 100644 --- a/packages/entities/entities-routes/vite.config.ts +++ b/packages/entities/entities-routes/vite.config.ts @@ -26,8 +26,7 @@ const config = mergeConfig(sharedViteConfig, defineConfig({ output: { // Provide global variables to use in the UMD build for externalized deps globals: { - '@kong-ui-public/expressions': '@kong-ui-public/expressions', - '@kong-ui-public/expressions/dist/style.css': '@kong-ui-public/expressions/dist/style.css', + '@kong-ui-public/expressions': 'kong-ui-public-expressions', 'lodash.isequal': 'lodash.isequal', }, }, From 786cde5b6e2e5b1ec64e69c4285ef6c19546df3f Mon Sep 17 00:00:00 2001 From: ValeryG Date: Thu, 29 Aug 2024 09:48:35 -0600 Subject: [PATCH 3/5] Update packages/analytics/analytics-geo-map/vite.config.ts Co-authored-by: Adam DeHaven <2229946+adamdehaven@users.noreply.github.com> --- packages/analytics/analytics-geo-map/vite.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/analytics/analytics-geo-map/vite.config.ts b/packages/analytics/analytics-geo-map/vite.config.ts index 48b949fc57..38f9294358 100644 --- a/packages/analytics/analytics-geo-map/vite.config.ts +++ b/packages/analytics/analytics-geo-map/vite.config.ts @@ -22,7 +22,7 @@ const config = mergeConfig(sharedViteConfig, defineConfig({ output: { // Provide global variables to use in the UMD build for externalized deps globals: { - 'maplibre-gl': 'maplibre-gl', + 'maplibre-gl': 'maplibregl', }, }, }, From 090daa96691a090e109e8688b886372f016cd104 Mon Sep 17 00:00:00 2001 From: ValeryG Date: Thu, 29 Aug 2024 09:49:16 -0600 Subject: [PATCH 4/5] Update vite.config.ts --- packages/analytics/analytics-metric-provider/vite.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/analytics/analytics-metric-provider/vite.config.ts b/packages/analytics/analytics-metric-provider/vite.config.ts index f1555f4c0e..d7dc890adf 100644 --- a/packages/analytics/analytics-metric-provider/vite.config.ts +++ b/packages/analytics/analytics-metric-provider/vite.config.ts @@ -29,7 +29,7 @@ const config = mergeConfig(sharedViteConfig, defineConfig({ globals: { '@kong-ui-public/analytics-config-store': 'kong-ui-public-analytics-config-store', '@kong-ui-public/analytics-utilities': 'kong-ui-public-analytics-utilities', - '@kong-ui-public/metric-cards': '@kong-ui-public/metric-cards', + '@kong-ui-public/metric-cards': 'kong-ui-public-metric-cards', pinia: 'pinia', }, }, From 5a6e4c61de0869e5cb224405f4ba68c3dc0ac2d2 Mon Sep 17 00:00:00 2001 From: ValeryG Date: Thu, 29 Aug 2024 09:50:38 -0600 Subject: [PATCH 5/5] Update vite.config.ts --- packages/entities/entities-routes/vite.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/entities/entities-routes/vite.config.ts b/packages/entities/entities-routes/vite.config.ts index e1cbd1e50a..e31900ec62 100644 --- a/packages/entities/entities-routes/vite.config.ts +++ b/packages/entities/entities-routes/vite.config.ts @@ -27,7 +27,6 @@ const config = mergeConfig(sharedViteConfig, defineConfig({ // Provide global variables to use in the UMD build for externalized deps globals: { '@kong-ui-public/expressions': 'kong-ui-public-expressions', - 'lodash.isequal': 'lodash.isequal', }, }, },