Conversation
✅ Deploy Preview for vite-plugin-pwa-legacy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the Vite 6 Environment API while maintaining backward compatibility with Vite 5. The changes enable the plugin to work with Vite's new environment-based architecture for handling client and server environments separately.
Key changes:
- Version detection mechanism to determine Vite 5 vs Vite 6 at runtime
- Environment-aware configuration using the new
configEnvironmenthook - Updated WebSocket/HMR handling to use the new
server.environments.client.hotAPI in Vite 6 - SSR-aware build handling to skip PWA asset generation in SSR builds
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/context.ts | Adds isVite6 Promise that detects Vite version by parsing the major version number from the imported Vite package |
| src/plugins/main.ts | Adds configEnvironment hook for Vite 6 environment configuration and updates the config and load hooks to be environment-aware |
| src/plugins/pwa-assets.ts | Updates handleHotUpdate and configureServer to use the new Environment API for module graph access and HMR communication in Vite 6 |
| src/plugins/dev.ts | Updates configureServer to use the new server.environments.client.hot API for WebSocket communication in Vite 6 |
| src/plugins/build.ts | Adds early return in generateBundle to skip PWA asset generation for SSR builds in Vite 6 |
| src/options.ts | Passes the isVite6 Promise to configureStaticAssets for SSR handling |
| src/assets.ts | Adds early return in configureStaticAssets to skip static asset configuration for SSR builds in Vite 6 |
| package.json | Adds pnpm overrides to force Vite 6.0.1 for the main project and Vite 5.0.12 for VitePress |
| pnpm-lock.yaml | Updates all dependency resolutions to reflect the Vite 6.0.1 upgrade and associated transitive dependency changes |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I need to review the plugins, looks like main resolve config hook being called 4 times per environment at nuxt pwa pr, last change/commit does nothing. I dont want to calculate assets hash 4 times, maybe we also need to export some utilities here and replace some other plugin at muxt integration. |
# Conflicts: # docs/package.json # package.json # pnpm-lock.yaml
Description
supersedes #786
Linked Issues
Additional Context
Tip
The author of this PR can publish a preview release by commenting
/publishbelow.