diff --git a/waspc/ChangeLog.md b/waspc/ChangeLog.md index f5c5d35403..b5180914ca 100644 --- a/waspc/ChangeLog.md +++ b/waspc/ChangeLog.md @@ -6,6 +6,24 @@ - Renamed and split `deserializeAndSanitizeProviderData` to `getProviderData` and `getProviderDataWithPassword` so it's more explicit if the resulting data will contain the hashed password or not. +- Deleted default `react` plugin in autogenerated vite.config.ts due to conflicts with vite's plugin resolution. + All current projects will need to explicitely add the [`@vitejs/plugin-react`](https://www.npmjs.com/package/@vitejs/plugin-react) themselves, + though now you're able to additionally modify the compiler. + Every new project will now generate `vite.config.ts` with following content: + +``` +import react from "@vitejs/plugin-react"; +import { defineConfig } from "vite"; + +export default defineConfig({ + server: { + open: true, + }, + plugins: [react()], +}); + +``` + ### 🔧 Small improvements - Enabled strict null checks for the Wasp SDK which means that some of the return types are more precise now e.g. you'll need to check if some value is `null` before using it. diff --git a/waspc/data/Cli/templates/basic/vite.config.ts b/waspc/data/Cli/templates/basic/vite.config.ts index a55924e2b6..1fbdd232bb 100644 --- a/waspc/data/Cli/templates/basic/vite.config.ts +++ b/waspc/data/Cli/templates/basic/vite.config.ts @@ -1,7 +1,9 @@ -import { defineConfig } from 'vite' +import react from "@vitejs/plugin-react"; +import { defineConfig } from "vite"; export default defineConfig({ server: { open: true, }, -}) + plugins: [react()], +}); diff --git a/waspc/data/Generator/templates/react-app/vite.config.ts b/waspc/data/Generator/templates/react-app/vite.config.ts index ab4224729f..1885550e64 100644 --- a/waspc/data/Generator/templates/react-app/vite.config.ts +++ b/waspc/data/Generator/templates/react-app/vite.config.ts @@ -1,7 +1,6 @@ {{={= =}=}} /// import { mergeConfig } from "vite"; -import react from "@vitejs/plugin-react"; import { defaultExclude } from "vitest/config" {=# customViteConfig.isDefined =} @@ -14,9 +13,10 @@ const _waspUserProvidedConfig = {=& customViteConfig.importIdentifier =} const _waspUserProvidedConfig = {}; {=/ customViteConfig.isDefined =} +// Plugins should not be defined here due to conflicts, see https://github.com/vitejs/vite/issues/16479 +// All plugins should always be defined within base templates and a migration path should be provided. const defaultViteConfig = { base: "{= baseDir =}", - plugins: [react()], optimizeDeps: { exclude: ['wasp'] },