From 08f232a16d9c31903f66eae189b0ccfa6593c36e Mon Sep 17 00:00:00 2001 From: Sergey Vinogradov Date: Mon, 13 Jan 2025 11:53:40 +0400 Subject: [PATCH] chore: add shared Vite config (#7029) --- shared/shared-vite-config.ts | 17 ++++++++++ shared/web-components-vite-plugin.ts | 31 ++++++++++++------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- .../vite.config.ts | 23 +++++--------- 48 files changed, 404 insertions(+), 702 deletions(-) create mode 100644 shared/shared-vite-config.ts diff --git a/shared/shared-vite-config.ts b/shared/shared-vite-config.ts new file mode 100644 index 00000000000..1f36518a616 --- /dev/null +++ b/shared/shared-vite-config.ts @@ -0,0 +1,17 @@ +import { UserConfigFn, mergeConfig } from 'vite'; +import { useLocalWebComponents } from './web-components-vite-plugin'; + +export const mergeConfigs = (...configs: UserConfigFn[]) => { + return configs.reduce((acc, config) => mergeConfig(acc, config)); +}; + +export const sharedConfig: UserConfigFn = (env) => ({ + plugins: [ + // Use local version of web-components, disabled by default. + // To use this, uncomment the lines below and change the path + // to your local web-components folder if needed (absolute or + // relative to this shared config). + // DO NOT COMMIT THESE CHANGES! + // useLocalWebComponents('../../web-components') + ] +}); diff --git a/shared/web-components-vite-plugin.ts b/shared/web-components-vite-plugin.ts index ce1d588a8dd..5d07d0a0926 100644 --- a/shared/web-components-vite-plugin.ts +++ b/shared/web-components-vite-plugin.ts @@ -4,24 +4,31 @@ import { PluginOption } from 'vite'; /** * Vite plugin that resolves Vaadin component JS modules to a * local checkout of the web-components repository - * @param webComponentsNodeModulesPath + * + * @param webComponentsRepoPath */ -export function useLocalWebComponents(webComponentsNodeModulesPath: string): PluginOption { +export function useLocalWebComponents(webComponentsRepoPath: string): PluginOption { + const nodeModulesPath = path.resolve(__dirname, `${webComponentsRepoPath}/node_modules`); + return { name: 'use-local-web-components', enforce: 'pre', - config(config) { - config.server = config.server ?? {}; - config.server.fs = config.server.fs ?? {}; - config.server.fs.allow = config.server.fs.allow ?? []; - config.server.fs.allow.push(webComponentsNodeModulesPath); - config.server.watch = config.server.watch ?? {}; - config.server.watch.ignored = [`!${webComponentsNodeModulesPath}/**`]; + config() { + return { + server: { + fs: { + allow: [nodeModulesPath] + }, + watch: { + ignored: [`!${nodeModulesPath}/**`] + } + } + }; }, resolveId(id) { if (/^(@polymer|@vaadin)/.test(id)) { - return this.resolve(path.join(webComponentsNodeModulesPath, id)); + return this.resolve(path.join(nodeModulesPath, id)); } - }, - } + } + }; } diff --git a/vaadin-accordion-flow-parent/vaadin-accordion-flow-integration-tests/vite.config.ts b/vaadin-accordion-flow-parent/vaadin-accordion-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-accordion-flow-parent/vaadin-accordion-flow-integration-tests/vite.config.ts +++ b/vaadin-accordion-flow-parent/vaadin-accordion-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-app-layout-flow-parent/vaadin-app-layout-flow-integration-tests/vite.config.ts b/vaadin-app-layout-flow-parent/vaadin-app-layout-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-app-layout-flow-parent/vaadin-app-layout-flow-integration-tests/vite.config.ts +++ b/vaadin-app-layout-flow-parent/vaadin-app-layout-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-avatar-flow-parent/vaadin-avatar-flow-integration-tests/vite.config.ts b/vaadin-avatar-flow-parent/vaadin-avatar-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-avatar-flow-parent/vaadin-avatar-flow-integration-tests/vite.config.ts +++ b/vaadin-avatar-flow-parent/vaadin-avatar-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-board-flow-parent/vaadin-board-flow-integration-tests/vite.config.ts b/vaadin-board-flow-parent/vaadin-board-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-board-flow-parent/vaadin-board-flow-integration-tests/vite.config.ts +++ b/vaadin-board-flow-parent/vaadin-board-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-button-flow-parent/vaadin-button-flow-integration-tests/vite.config.ts b/vaadin-button-flow-parent/vaadin-button-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-button-flow-parent/vaadin-button-flow-integration-tests/vite.config.ts +++ b/vaadin-button-flow-parent/vaadin-button-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-card-flow-parent/vaadin-card-flow-integration-tests/vite.config.ts b/vaadin-card-flow-parent/vaadin-card-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-card-flow-parent/vaadin-card-flow-integration-tests/vite.config.ts +++ b/vaadin-card-flow-parent/vaadin-card-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-charts-flow-parent/vaadin-charts-flow-integration-tests/vite.config.ts b/vaadin-charts-flow-parent/vaadin-charts-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-charts-flow-parent/vaadin-charts-flow-integration-tests/vite.config.ts +++ b/vaadin-charts-flow-parent/vaadin-charts-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-checkbox-flow-parent/vaadin-checkbox-flow-integration-tests/vite.config.ts b/vaadin-checkbox-flow-parent/vaadin-checkbox-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-checkbox-flow-parent/vaadin-checkbox-flow-integration-tests/vite.config.ts +++ b/vaadin-checkbox-flow-parent/vaadin-checkbox-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-combo-box-flow-parent/vaadin-combo-box-flow-integration-tests/vite.config.ts b/vaadin-combo-box-flow-parent/vaadin-combo-box-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-combo-box-flow-parent/vaadin-combo-box-flow-integration-tests/vite.config.ts +++ b/vaadin-combo-box-flow-parent/vaadin-combo-box-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-confirm-dialog-flow-parent/vaadin-confirm-dialog-flow-integration-tests/vite.config.ts b/vaadin-confirm-dialog-flow-parent/vaadin-confirm-dialog-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-confirm-dialog-flow-parent/vaadin-confirm-dialog-flow-integration-tests/vite.config.ts +++ b/vaadin-confirm-dialog-flow-parent/vaadin-confirm-dialog-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-context-menu-flow-parent/vaadin-context-menu-flow-integration-tests/vite.config.ts b/vaadin-context-menu-flow-parent/vaadin-context-menu-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-context-menu-flow-parent/vaadin-context-menu-flow-integration-tests/vite.config.ts +++ b/vaadin-context-menu-flow-parent/vaadin-context-menu-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-cookie-consent-flow-parent/vaadin-cookie-consent-flow-integration-tests/vite.config.ts b/vaadin-cookie-consent-flow-parent/vaadin-cookie-consent-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-cookie-consent-flow-parent/vaadin-cookie-consent-flow-integration-tests/vite.config.ts +++ b/vaadin-cookie-consent-flow-parent/vaadin-cookie-consent-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-crud-flow-parent/vaadin-crud-flow-integration-tests/vite.config.ts b/vaadin-crud-flow-parent/vaadin-crud-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-crud-flow-parent/vaadin-crud-flow-integration-tests/vite.config.ts +++ b/vaadin-crud-flow-parent/vaadin-crud-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-custom-field-flow-parent/vaadin-custom-field-flow-integration-tests/vite.config.ts b/vaadin-custom-field-flow-parent/vaadin-custom-field-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-custom-field-flow-parent/vaadin-custom-field-flow-integration-tests/vite.config.ts +++ b/vaadin-custom-field-flow-parent/vaadin-custom-field-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-dashboard-flow-parent/vaadin-dashboard-flow-integration-tests/vite.config.ts b/vaadin-dashboard-flow-parent/vaadin-dashboard-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-dashboard-flow-parent/vaadin-dashboard-flow-integration-tests/vite.config.ts +++ b/vaadin-dashboard-flow-parent/vaadin-dashboard-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-date-picker-flow-parent/vaadin-date-picker-flow-integration-tests/vite.config.ts b/vaadin-date-picker-flow-parent/vaadin-date-picker-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-date-picker-flow-parent/vaadin-date-picker-flow-integration-tests/vite.config.ts +++ b/vaadin-date-picker-flow-parent/vaadin-date-picker-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow-integration-tests/vite.config.ts b/vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow-integration-tests/vite.config.ts +++ b/vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-details-flow-parent/vaadin-details-flow-integration-tests/vite.config.ts b/vaadin-details-flow-parent/vaadin-details-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-details-flow-parent/vaadin-details-flow-integration-tests/vite.config.ts +++ b/vaadin-details-flow-parent/vaadin-details-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-dialog-flow-parent/vaadin-dialog-flow-integration-tests/vite.config.ts b/vaadin-dialog-flow-parent/vaadin-dialog-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-dialog-flow-parent/vaadin-dialog-flow-integration-tests/vite.config.ts +++ b/vaadin-dialog-flow-parent/vaadin-dialog-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-field-highlighter-flow-parent/vaadin-field-highlighter-flow-integration-tests/vite.config.ts b/vaadin-field-highlighter-flow-parent/vaadin-field-highlighter-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-field-highlighter-flow-parent/vaadin-field-highlighter-flow-integration-tests/vite.config.ts +++ b/vaadin-field-highlighter-flow-parent/vaadin-field-highlighter-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-form-layout-flow-parent/vaadin-form-layout-flow-integration-tests/vite.config.ts b/vaadin-form-layout-flow-parent/vaadin-form-layout-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-form-layout-flow-parent/vaadin-form-layout-flow-integration-tests/vite.config.ts +++ b/vaadin-form-layout-flow-parent/vaadin-form-layout-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-grid-pro-flow-parent/vaadin-grid-pro-flow-integration-tests/vite.config.ts b/vaadin-grid-pro-flow-parent/vaadin-grid-pro-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-grid-pro-flow-parent/vaadin-grid-pro-flow-integration-tests/vite.config.ts +++ b/vaadin-grid-pro-flow-parent/vaadin-grid-pro-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-icons-flow-parent/vaadin-icons-flow-integration-tests/vite.config.ts b/vaadin-icons-flow-parent/vaadin-icons-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-icons-flow-parent/vaadin-icons-flow-integration-tests/vite.config.ts +++ b/vaadin-icons-flow-parent/vaadin-icons-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-list-box-flow-parent/vaadin-list-box-flow-integration-tests/vite.config.ts b/vaadin-list-box-flow-parent/vaadin-list-box-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-list-box-flow-parent/vaadin-list-box-flow-integration-tests/vite.config.ts +++ b/vaadin-list-box-flow-parent/vaadin-list-box-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-login-flow-parent/vaadin-login-flow-integration-tests/vite.config.ts b/vaadin-login-flow-parent/vaadin-login-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-login-flow-parent/vaadin-login-flow-integration-tests/vite.config.ts +++ b/vaadin-login-flow-parent/vaadin-login-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-lumo-theme-flow-parent/vaadin-lumo-theme-flow-integration-tests/vite.config.ts b/vaadin-lumo-theme-flow-parent/vaadin-lumo-theme-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-lumo-theme-flow-parent/vaadin-lumo-theme-flow-integration-tests/vite.config.ts +++ b/vaadin-lumo-theme-flow-parent/vaadin-lumo-theme-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-map-flow-parent/vaadin-map-flow-integration-tests/vite.config.ts b/vaadin-map-flow-parent/vaadin-map-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-map-flow-parent/vaadin-map-flow-integration-tests/vite.config.ts +++ b/vaadin-map-flow-parent/vaadin-map-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-material-theme-flow-parent/vaadin-material-theme-flow-integration-tests/vite.config.ts b/vaadin-material-theme-flow-parent/vaadin-material-theme-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-material-theme-flow-parent/vaadin-material-theme-flow-integration-tests/vite.config.ts +++ b/vaadin-material-theme-flow-parent/vaadin-material-theme-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow-integration-tests/vite.config.ts b/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow-integration-tests/vite.config.ts +++ b/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/vite.config.ts b/vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/vite.config.ts +++ b/vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-notification-flow-parent/vaadin-notification-flow-integration-tests/vite.config.ts b/vaadin-notification-flow-parent/vaadin-notification-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-notification-flow-parent/vaadin-notification-flow-integration-tests/vite.config.ts +++ b/vaadin-notification-flow-parent/vaadin-notification-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow-integration-tests/vite.config.ts b/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow-integration-tests/vite.config.ts +++ b/vaadin-ordered-layout-flow-parent/vaadin-ordered-layout-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-popover-flow-parent/vaadin-popover-flow-integration-tests/vite.config.ts b/vaadin-popover-flow-parent/vaadin-popover-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-popover-flow-parent/vaadin-popover-flow-integration-tests/vite.config.ts +++ b/vaadin-popover-flow-parent/vaadin-popover-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-progress-bar-flow-parent/vaadin-progress-bar-flow-integration-tests/vite.config.ts b/vaadin-progress-bar-flow-parent/vaadin-progress-bar-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-progress-bar-flow-parent/vaadin-progress-bar-flow-integration-tests/vite.config.ts +++ b/vaadin-progress-bar-flow-parent/vaadin-progress-bar-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-radio-button-flow-parent/vaadin-radio-button-flow-integration-tests/vite.config.ts b/vaadin-radio-button-flow-parent/vaadin-radio-button-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-radio-button-flow-parent/vaadin-radio-button-flow-integration-tests/vite.config.ts +++ b/vaadin-radio-button-flow-parent/vaadin-radio-button-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-renderer-flow-parent/vaadin-renderer-flow-integration-tests/vite.config.ts b/vaadin-renderer-flow-parent/vaadin-renderer-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-renderer-flow-parent/vaadin-renderer-flow-integration-tests/vite.config.ts +++ b/vaadin-renderer-flow-parent/vaadin-renderer-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-rich-text-editor-flow-parent/vaadin-rich-text-editor-flow-integration-tests/vite.config.ts b/vaadin-rich-text-editor-flow-parent/vaadin-rich-text-editor-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-rich-text-editor-flow-parent/vaadin-rich-text-editor-flow-integration-tests/vite.config.ts +++ b/vaadin-rich-text-editor-flow-parent/vaadin-rich-text-editor-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-select-flow-parent/vaadin-select-flow-integration-tests/vite.config.ts b/vaadin-select-flow-parent/vaadin-select-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-select-flow-parent/vaadin-select-flow-integration-tests/vite.config.ts +++ b/vaadin-select-flow-parent/vaadin-select-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-side-nav-flow-parent/vaadin-side-nav-flow-integration-tests/vite.config.ts b/vaadin-side-nav-flow-parent/vaadin-side-nav-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-side-nav-flow-parent/vaadin-side-nav-flow-integration-tests/vite.config.ts +++ b/vaadin-side-nav-flow-parent/vaadin-side-nav-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-split-layout-flow-parent/vaadin-split-layout-flow-integration-tests/vite.config.ts b/vaadin-split-layout-flow-parent/vaadin-split-layout-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-split-layout-flow-parent/vaadin-split-layout-flow-integration-tests/vite.config.ts +++ b/vaadin-split-layout-flow-parent/vaadin-split-layout-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-integration-tests/vite.config.ts b/vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-integration-tests/vite.config.ts +++ b/vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-tabs-flow-parent/vaadin-tabs-flow-integration-tests/vite.config.ts b/vaadin-tabs-flow-parent/vaadin-tabs-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-tabs-flow-parent/vaadin-tabs-flow-integration-tests/vite.config.ts +++ b/vaadin-tabs-flow-parent/vaadin-tabs-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-text-field-flow-parent/vaadin-text-field-flow-integration-tests/vite.config.ts b/vaadin-text-field-flow-parent/vaadin-text-field-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-text-field-flow-parent/vaadin-text-field-flow-integration-tests/vite.config.ts +++ b/vaadin-text-field-flow-parent/vaadin-text-field-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-time-picker-flow-parent/vaadin-time-picker-flow-integration-tests/vite.config.ts b/vaadin-time-picker-flow-parent/vaadin-time-picker-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-time-picker-flow-parent/vaadin-time-picker-flow-integration-tests/vite.config.ts +++ b/vaadin-time-picker-flow-parent/vaadin-time-picker-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-upload-flow-parent/vaadin-upload-flow-integration-tests/vite.config.ts b/vaadin-upload-flow-parent/vaadin-upload-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-upload-flow-parent/vaadin-upload-flow-integration-tests/vite.config.ts +++ b/vaadin-upload-flow-parent/vaadin-upload-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +)); diff --git a/vaadin-virtual-list-flow-parent/vaadin-virtual-list-flow-integration-tests/vite.config.ts b/vaadin-virtual-list-flow-parent/vaadin-virtual-list-flow-integration-tests/vite.config.ts index d8518d74ada..bd0ce4ce0ae 100644 --- a/vaadin-virtual-list-flow-parent/vaadin-virtual-list-flow-integration-tests/vite.config.ts +++ b/vaadin-virtual-list-flow-parent/vaadin-virtual-list-flow-integration-tests/vite.config.ts @@ -1,23 +1,16 @@ // @ts-ignore can not be resolved until NPM packages are installed -import { UserConfigFn } from 'vite'; +import { defineConfig, UserConfigFn } from 'vite'; // @ts-ignore can not be resolved until Flow generates base Vite config -import { overrideVaadinConfig } from './vite.generated'; -// import { useLocalWebComponents } from '../../shared/web-components-vite-plugin'; +import { vaadinConfig } from './vite.generated'; +import { sharedConfig, mergeConfigs } from '../../shared/shared-vite-config'; const customConfig: UserConfigFn = (env) => ({ // Here you can add custom Vite parameters // https://vitejs.dev/config/ - - // Use local version of web-components, disabled by default - // To use this un-comment the lines below and change the path to - // the absolute path of your web-components repo's node_modules - // folder - // DO NOT COMMIT THESE CHANGES! - /* - plugins: [ - useLocalWebComponents('/path/to/web-components/node_modules') - ] - */ }); -export default overrideVaadinConfig(customConfig); +export default defineConfig((env) => mergeConfigs( + vaadinConfig(env), + sharedConfig(env), + customConfig(env) +));