Skip to content

Feat: Migration to Vite & Live Preview Updates #85

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Contentstack-AnkitaD
Copy link

@Contentstack-AnkitaD Contentstack-AnkitaD commented May 9, 2025

Migration to Vite & Live Preview Updates

This PR includes a comprehensive migration from Create React App (CRA) to Vite along with updates to the live preview utilities. The changes optimize the development experience, build performance, and improve code maintainability.

1. React App Migration from CRA to Vite

Configuration & Build Optimization

  • Added complete Vite configuration with build optimizations
  • Implemented smart chunk splitting strategy that reduced bundle sizes
  • Updated TypeScript configuration for compatibility with Vite
  • Created proper environment variable declarations
  • Configured browser compatibility settings via .browserslistrc

Live Preview Updates

  • Installed latest package for live preview and Visual Builder Support
  • Refactored utils.ts to centralize environment variable access
  • Enhanced initialization logic for Contentstack SDK

Performance Results

The build output shows successful chunking with optimized sizes:

router-vendor: 9.06 kB (gzipped: 4.01 kB)
app code: 22.84 kB (gzipped: 6.64 kB)
react-vendor: 174.90 kB (gzipped: 56.70 kB)
vendor: 278.38 kB (gzipped: 98.46 kB)
contentstack-vendor: 373.27 kB (gzipped: 101.72 kB)

3. Documentation Updates

  • Added Vite-specific information to README.md with usage instructions
  • Updated development, build, and preview commands

4. Testing Results

  • The application builds without warnings
  • Development server runs correctly on port 3000
  • Live Preview functionality works properly with the updated structure
  • All chunks are properly split and optimized

@Contentstack-AnkitaD Contentstack-AnkitaD requested a review from a team as a code owner May 9, 2025 15:04
Copy link

@rijil-tr rijil-tr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we moved to Vite?

@Contentstack-AnkitaD Contentstack-AnkitaD changed the title chore: update live preview utils to latest version and adjust initialization settings Feat: Migration to Vite & Live Preview Updates May 12, 2025
@Contentstack-AnkitaD Contentstack-AnkitaD requested a review from a team May 12, 2025 11:53
@Contentstack-AnkitaD
Copy link
Author

Can we moved to Vite?

Moved

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.

4 participants