chore: migrate from Webpack to Vite and modernize build toolchain#44
Merged
prabhuignoto merged 5 commits intomainfrom Nov 12, 2025
Merged
chore: migrate from Webpack to Vite and modernize build toolchain#44prabhuignoto merged 5 commits intomainfrom
prabhuignoto merged 5 commits intomainfrom
Conversation
This commit completes a comprehensive modernization of the build system and development tooling: ## Build System Migration - **Webpack → Vite**: Replaced Webpack with Vite for significantly faster builds and HMR - **Multi-format outputs**: Library now exports ESM, CJS, and UMD formats with proper package.json exports field - **TypeScript declarations**: Automated generation via vite-plugin-dts - **SWC compiler**: Replaced Babel with @vitejs/plugin-react-swc for faster transpilation ## Configuration Changes - **vite.config.ts**: Complete library build configuration with rollupOptions for multiple formats - **postcss.config.js**: Modern PostCSS setup (postcss-preset-env, autoprefixer, cssnano) - **eslint.config.js**: Migrated to ESLint v9 flat config format (new standard) - **.stylelintrc.json**: Simplified for Stylelint v16 compatibility - **tsconfig.json**: Updated moduleResolution to "bundler" for modern tooling ## Dependency Updates - Removed 21+ legacy packages (Webpack, Babel, loaders, plugins) - Upgraded core tools: ESLint 8→9, TypeScript, Sass, PostCSS, Stylelint - Added new tools: vite-plugin-dts, prettier, postcss-scss - Updated to latest SWC and React plugin versions ## Scripts & Workflows - Simplified package.json scripts: `build:prod/dev` → `build` - Added `typecheck` script for standalone type checking - Updated GitHub Actions workflows to use Vite and Node 20.x LTS - Improved caching and dependency management in CI/CD ## Developer Experience Improvements - 10-20x faster cold starts with Vite - Near-instant HMR for faster development - Modern ESLint flat config reduces configuration overhead - Better error messages and dev tooling ## Documentation - Updated CLAUDE.md with new build commands and architecture - All build outputs verified (dist/ contains ESM, CJS, UMD, type declarations) - Tests pass with Vitest v2, linting clean with modernized configs Breaking changes: - Library now requires modern bundlers that understand package.json exports field - Removed babel-plugin-remove-attribute (data-cy attributes no longer stripped in production) - ESLint consumers must migrate to flat config or use ESLint v8 compatibility mode
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Fixed duplicate build.lib.formats warning by removing redundant config - Added globals.d.ts to vite-plugin-dts include to resolve SCSS module type errors - Configured vite-plugin-dts with proper tsconfig path and skipLibCheck - Set logLevel to 'error' to suppress non-critical diagnostics - Simplified tsconfig include patterns for better maintainability - Build now completes without TypeScript errors for SCSS imports All three output formats (ESM, CJS, UMD) build cleanly with proper type declarations.
- Eliminated unnecessary code that parsed package.json, streamlining the configuration file.
- Cleaned up vite.config.ts by removing the unnecessary import of readFileSync from 'fs', streamlining the configuration file.
This file contains hidden or 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
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.
This commit completes a comprehensive modernization of the build system and development tooling:
Build System Migration
Configuration Changes
Dependency Updates
Scripts & Workflows
build:prod/dev→buildtypecheckscript for standalone type checkingDeveloper Experience Improvements
Documentation
Breaking changes: