From 87bb7a6a1534a42c6d3034e5e6f352dc25ad60d8 Mon Sep 17 00:00:00 2001 From: Philippe Serhal Date: Fri, 19 Sep 2025 10:43:53 -0400 Subject: [PATCH] fix: update `netlify` addon for upcoming changes --- .../react-cra/add-ons/netlify/README.md | 21 +++++++++++++++---- .../add-ons/netlify/assets/netlify.toml | 6 ++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 frameworks/react-cra/add-ons/netlify/assets/netlify.toml diff --git a/frameworks/react-cra/add-ons/netlify/README.md b/frameworks/react-cra/add-ons/netlify/README.md index 74c19e2c..f2a6bed2 100644 --- a/frameworks/react-cra/add-ons/netlify/README.md +++ b/frameworks/react-cra/add-ons/netlify/README.md @@ -1,11 +1,24 @@ ## Setting up Netlify -First install the Netlify CLI with: +Install the [`@netlify/vite-plugin-tanstack-start`](https://www.npmjs.com/package/@netlify/vite-plugin-tanstack-start) plugin: ```bash -npm install -g netlify-cli` +npm install -D @netlify/vite-plugin-tanstack-start ``` -```bash -netlify init +Add the plugin to your `vite.config.ts`: + +```ts +import netlify from '@netlify/vite-plugin-tanstack-start' + +export default defineConfig({ + plugins: [ + // ... your existing plugins + netlify(), + ], +}) ``` + +A `netlify.toml` file has been automatically created for you with the correct build settings. + +That's it. You can now deploy your app [from Netlify UI](https://docs.netlify.com/start/add-new-project/#import-from-an-existing-repository) or with the [Netlify CLI](https://docs.netlify.com/api-and-cli-guides/cli-guides/get-started-with-cli/#manual-deploys). diff --git a/frameworks/react-cra/add-ons/netlify/assets/netlify.toml b/frameworks/react-cra/add-ons/netlify/assets/netlify.toml new file mode 100644 index 00000000..5b73675b --- /dev/null +++ b/frameworks/react-cra/add-ons/netlify/assets/netlify.toml @@ -0,0 +1,6 @@ +[build] + command = "vite build" + dir = "dist/client" +[dev] + command = "vite dev" + port = 3000