rsbuild-plugin-cloudflare 0.0.3 → 0.0.5

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 CHANGED
@@ -227,6 +227,10 @@ Other differences:
227
227
  Rsbuild uses an environment's settings over the top-level ones. Set them in
228
228
  `environments.<name>` instead. The top-level `output.sourceMap`, and the
229
229
  `output.minify` setting for CSS, do apply.
230
+ - Workers' CSS is compiled for Rsbuild's browserslist (the client's, unless
231
+ `output.overrideBrowserslist` is set for the Worker's environment), so that
232
+ it matches the client's stylesheets. The Vite plugin targets `es2024` unless
233
+ `build.cssTarget` is set.
230
234
  - Without `source.entry` or client environments, a client is built from
231
235
  Rsbuild's default entry (`src/index.*`) only when `index.html` exists at the
232
236
  project root, where Vite builds one whenever `index.html` exists. The default
@@ -234,8 +238,8 @@ Other differences:
234
238
  bare specifier isn't recognised as it. Rsbuild doesn't use that `index.html`
235
239
  as the page's template unless `html.template` is set to it. Without a client,
236
240
  as in the Vite plugin, the client output has only the public assets (and the
237
- assets that the entry Worker imports), and `assetsOnly` requires public assets
238
- or a prerender Worker.
241
+ assets that the entry and prerender Workers import), and `assetsOnly` requires
242
+ public assets or a prerender Worker.
239
243
  - `devOnly` and `assetsOnly` functions are called when the config is resolved,
240
244
  to choose the Worker environments to build, rather than lazily at build time.
241
245
  - Additional modules (e.g. `.wasm` and `.txt` imports) are emitted at the root
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { InputWorkerConfig, ParsedInputConfig, ParsedInputWorkerConfig } from "@cloudflare/config";
1
+ import { InputWorkerConfig, ParsedInputConfig, ParsedInputWorkerConfig, WorkerConfig } from "@cloudflare/config";
2
2
  import { RsbuildPlugin } from "@rsbuild/core";
3
3
 
4
4
  //#region ../../workers-sdk/packages/vite-plugin-cloudflare/src/plugin-config.d.ts
5
5
 
6
6
  /** Parsed configuration with the entry Worker required by the Vite plugin. */
7
- type ParsedInputConfigWithWorker = Omit<ParsedInputConfig, "worker"> & {
7
+ type CloudflareConfig = Omit<ParsedInputConfig, "worker"> & {
8
8
  worker: ParsedInputWorkerConfig;
9
9
  };
10
10
  type PersistState = boolean | {
@@ -76,7 +76,7 @@ interface PluginConfig$1 extends EntryWorkerOptions {
76
76
  * Return a new configuration object including an entry Worker, copying any settings to preserve.
77
77
  * Preview uses the configuration recorded in the build output.
78
78
  */
79
- config?: (loadedConfig: ParsedInputConfigWithWorker) => ParsedInputConfigWithWorker;
79
+ config?: (loadedConfig: CloudflareConfig) => CloudflareConfig;
80
80
  auxiliaryWorkers?: AuxiliaryWorkerOptions[];
81
81
  /** Configuration for a dedicated prerender Worker. */
82
82
  prerenderWorker?: PrerenderWorkerOptions;
@@ -129,4 +129,4 @@ interface PluginConfig extends RsbuildWorkerOptions<Omit<PluginConfig$1, "tunnel
129
129
  */
130
130
  declare function cloudflare(options?: PluginConfig): RsbuildPlugin;
131
131
  //#endregion
132
- export { PluginConfig, cloudflare };
132
+ export { type CloudflareConfig, PluginConfig, type WorkerConfig, cloudflare };