-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update Vite config for example apps [EXT-6273] #9593
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
✅ Deploy Preview for ecommerce-app-base-components canceled.
|
david-shibley-contentful
approved these changes
Mar 24, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
We updated the example apps to use Vite instead of CRA/react-scripts in this PR. However, a few things were missed, so this PR aims to clean those up. We fixed up the delivery function examples in this other PR, so this current PR updates the rest of the examples that were migrated to Vite.
Approach
Here's an overview of the changes:
Vite updates
./build
instead of the default./dist
. We are standardizing on this for our examples because thebuild-functions
script from the@contentful/app-scripts
package expects this to be the name for the build directory. Even for apps that don't have functions, we want to be consistent in case the user adds functions to their app./// <reference types="vitest/config" />
when using Vitest, adding the triple slash command as documented herestart
script in package.json in addition to todev
tsconfig.json
updatestsconfig
and the associatedreact-app-env.d.ts
file; add any necessary configuration after removing thattsconfig.json
like our function templatesDocumentation updates
README
filesExample-specific changes
The
app-actions
app did not need to be updated to Vite since it already usesnext
. So I reverted the changes that were previously made.Testing steps
I tested these locally in the apps repo and also tested them using CCA according these instructions. I ran the apps locally and also built and uploaded them.
Breaking Changes
Dependencies and/or References
Deployment