Skip to content

Commit

Permalink
Version Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 13, 2025
1 parent ca3cbc4 commit 81e9393
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
21 changes: 0 additions & 21 deletions .changeset/wild-days-jog.md

This file was deleted.

22 changes: 22 additions & 0 deletions packages/vite-plugin-cloudflare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# @cloudflare/vite-plugin

## 0.1.1

### Patch Changes

- [#8118](https://github.com/cloudflare/workers-sdk/pull/8118) [`ca3cbc4`](https://github.com/cloudflare/workers-sdk/commit/ca3cbc42ad60c04148ea6c4cd3d2cc06c94b3814) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix Node.js compat module resolution

In v0.0.8 we landed support for Vite 6.1 and also switched to using the new Cloudflare owned unenv preset.
Unfortunately, the changes made in that update caused a regression in Node.js support.
This became apparent only when the plugin was being used with certain package managers and outside of the workers-sdk monorepo.

The unenv polyfills that get compiled into the Worker are transitive dependencies of this plugin, not direct dependencies of the user's application were the plugin is being used.
This is on purpose to avoid the user having to install these dependencies themselves.

Unfortunately, the changes in 0.0.8 did not correctly resolve the polyfills from `@cloudflare/unenv-preset` and `unenv` when the dependencies were not also installed directly into the user's application.

The approach was incorrectly relying upon setting the `importer` in calls to Vite's `resolve(id, importer)` method to base the resolution in the context of the vite plugin package rather than the user's application.
This doesn't work because the `importer` is only relevant when the `id` is relative, and not a bare module specifier in the case of the unenv polyfills.

This change fixes how these id are resolved in the plugin by manually resolving the path at the appropriate point, while still leveraging Vite's resolution pipeline to handle aliasing, and dependency optimization.

This change now introduces e2e tests that checks that isolated installations of the plugin works with npm, pnpm and yarn.

## 0.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflare/vite-plugin",
"version": "0.1.0",
"version": "0.1.1",
"description": "Cloudflare plugin for Vite",
"keywords": [
"cloudflare",
Expand Down

0 comments on commit 81e9393

Please sign in to comment.