Skip to content

feat!: add Vite Environment API support#219

Draft
userquin wants to merge 1 commit intomainfrom
userquin/feat-add-vite-env-api-support
Draft

feat!: add Vite Environment API support#219
userquin wants to merge 1 commit intomainfrom
userquin/feat-add-vite-env-api-support

Conversation

@userquin
Copy link
Member

@userquin userquin commented Nov 18, 2025

Description

Right now the webmanifest not being added to the sw precache manifest (and not being generated using nr dev:build), tried with a client plugin (it seems the folder being cleared => node_modules/.cache/nuxt/.nuxt/manifests), also with rollup:before => there is no way.

We need to know "when" we can build the webmanifest.

Using PWA plugin from pkg-pr-new from this PR vite-pwa/vite-plugin-pwa#903

Linked Issues

Additional Context

We should add to Nuxt docs we only have a single dev server for both environments, I also need to check with generate command (maybe it is also broken here).

Playing with Vite Env. API and future.compatibility = 5 seems to break Nuxt Dev Tools when there is no layout; vite-rolldown also broken with Vite Env. API (with empty project, some Vite plugin breaking Nuxt)


Tip

The author of this PR can publish a preview release by commenting /publish below.

@userquin userquin marked this pull request as draft November 18, 2025 10:53
@userquin
Copy link
Member Author

userquin commented Nov 18, 2025

Arrg, something is broken, if we add webmanifest at globPatterns when using Env. API it is added, but running it without Env. API webmanifest added twice, something is running with wrong configuration when enabling Env. API.

Looks like this if stmt. breaking webmanifest here: https://github.com/vite-pwa/vite-plugin-pwa/pull/786/files#diff-001347cc727cf0cda0ccc53a07a92207e342ab83fe88aaa789b752a9e9ea5832R61-R62

Previous function being called from main PWA plugin, it is shared between environments (?) but SSR being used 🤔

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.

1 participant