rspack-plugin-cloudflare 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Run Cloudflare Workers in workerd while developing with `rspack serve`, with hot
|
|
|
15
15
|
npm install --save-dev rspack-plugin-cloudflare @rspack/core @rspack/cli @rspack/dev-server wrangler
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Requires Node.js 24.10 or later.
|
|
18
|
+
Requires Node.js 24.10 or later. `wrangler` is a peer dependency, so you pick its version: the plugin runs your Worker with the Miniflare and workerd that your wrangler ships, and newer compatibility dates arrive when you update wrangler.
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
|
@@ -156,7 +156,7 @@ node --run test
|
|
|
156
156
|
|
|
157
157
|
`node --run test` lints, type checks, builds and runs the test suite, which starts real `rspack serve` and `rspack build` runs against the fixtures in `test/fixtures`.
|
|
158
158
|
|
|
159
|
-
Cloudflare's router and asset Workers and their `_headers` and `_redirects` parsers come from `@cloudflare/workers-shared`, which isn't published. The `workers-sdk` submodule is pinned to the commit of the wrangler release we
|
|
159
|
+
Cloudflare's router and asset Workers and their `_headers` and `_redirects` parsers come from `@cloudflare/workers-shared`, which isn't published. The `workers-sdk` submodule is pinned to the commit of the wrangler release we test against, and `node --run build` bundles that code into `dist`. The daily Sync upstream workflow moves that wrangler, the packages it pins and the submodule to the latest wrangler release together and opens a pull request, which merges and releases itself once CI passes. CI also tests the oldest wrangler the peer range allows. To do the same locally, run `node scripts/sync-upstream.ts [version]`.
|
|
160
160
|
|
|
161
161
|
Releases are automated. Merging to `main` runs [semantic-release](https://github.com/semantic-release/semantic-release), which picks the version from the [conventional commit](https://www.conventionalcommits.org/) titles since the last release and publishes to npm through trusted publishing, with provenance. Pull requests are squash merged, so the pull request title is the commit that counts.
|
|
162
162
|
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import { maybeStartOrUpdateRemoteProxySession, unstable_convertConfigBindingsToS
|
|
|
6
6
|
import { createHash, randomUUID } from "node:crypto";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { getCloudflarePreset } from "@cloudflare/unenv-preset";
|
|
9
|
-
import * as miniflare from "miniflare";
|
|
10
9
|
import { defineEnv } from "unenv";
|
|
11
10
|
import { convertToWranglerConfig, loadAndParseConfig } from "@cloudflare/config";
|
|
12
11
|
import { normalizeAndValidateConfig } from "@cloudflare/workers-utils";
|
|
@@ -55,6 +54,7 @@ function getModuleTypes(worker) {
|
|
|
55
54
|
}
|
|
56
55
|
return types;
|
|
57
56
|
}
|
|
57
|
+
const miniflare = createRequire(import.meta.resolve("wrangler"))("miniflare");
|
|
58
58
|
// src/nodejs-compat.ts
|
|
59
59
|
function resolvePolyfill(specifier) {
|
|
60
60
|
return fileURLToPath(import.meta.resolve(specifier));
|