Explore the advantages of using Vite for your React app on Amplify, with step-by-step instructions on setting it up, and resources to help you migrate from Create React App.
When it comes to starting a new React app on Amplify, the Amplify docs suggest using Create React App. But now, there's a new player in town: Vite. Vite is a great alternative for creating single-page React applications. However, Create React App has some of the best pre-configured and battle-tested browser polyfills for web applications that need broad support across browsers, particularly in corporate environments.
Despite this, for projects that want to embrace the latest and greatest, Vite provides some definite advantages. However, some changes to the default Vite project start need to be done to support the use of the AWS SDK. Issue #3673.
##Scaffolding Your Vite Project
To start off with typescript use --template react-ts
With NPM:
$ npm create vite@latest my-vue-app --template react
With Yarn:
$ yarn create vite my-vue-app --template react
With PNPM:
$ pnpm create vite my-vue-app --template react