Skip to content
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 in JS and TS example apps [EXT-6273] #9570

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

whitelisab
Copy link
Contributor

Purpose

We updated the JS and TS apps to use Vite instead of CRA in this PR: #9516. This is a follow up PR to fix a few items in these examples; fixing a bug with how these templates work with the function templates and updating some dependencies.

Approach

Here's a summary of the updates:

  • When CCA users use a function template, the resulting code is based off of these TS or JS examples with functions added to them. The functions build script expects the build to be in a ./build directory, but these examples were set to ./dist for the build directory. In order to accommodate the functions templates, we are changing the build directory to ./build for these TS and JS templates
  • Added a npm start script in addition to npm dev since the README and index.html files mention running npm start to get started with the template
  • Bumped Vite, Vitest, and App Scripts dependencies
  • Made the port for the local server 3000, since this is the default used by App Scripts when creating an app definition
  • Removed CRA tsconfig from the TS example and updated the tsconfig with a base config
  • Removed the unneeded React import from the TS components
  • Renamed the vite.config files to import the ESM build of Vite and remove a warning (see more here)

Testing steps

I tested this locally within this repo and also with the CCA by pointing to this branch. I tested this with the TS and JS base templates and also the function templates.

Breaking Changes

Dependencies and/or References

Deployment

@whitelisab whitelisab requested a review from a team as a code owner March 18, 2025 15:15
Copy link

netlify bot commented Mar 18, 2025

Deploy Preview for ecommerce-app-base-components canceled.

Name Link
🔨 Latest commit a0e92d1
🔍 Latest deploy log https://app.netlify.com/sites/ecommerce-app-base-components/deploys/67d98e1aecbe7d00097ebc63

@whitelisab whitelisab merged commit 87bfafa into master Mar 18, 2025
17 checks passed
@whitelisab whitelisab deleted the fix/ext-6273-vite-base-examples branch March 18, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants