rspack-plugin-cloudflare 0.2.0 → 0.3.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 CHANGED
@@ -41,6 +41,8 @@ The Worker is configured in your existing `wrangler.toml` / `wrangler.json(c)`,
41
41
 
42
42
  Set `CLOUDFLARE_ENV` to pick a Wrangler environment for dev and build, as with the Vite plugin.
43
43
 
44
+ `minify = true` in the Wrangler config minifies the Worker in `rspack build`, since `wrangler deploy` no longer bundles it. Dev stays unminified, and source maps are uploaded either way unless `upload_source_maps = false`.
45
+
44
46
  ### Options
45
47
 
46
48
  | Option | Default | |
package/dist/index.js CHANGED
@@ -278,7 +278,7 @@ function createWorkerConfig(options) {
278
278
  }, { oneOf: getAssetRules(worker, textExtensions) }] },
279
279
  devtool: "source-map",
280
280
  optimization: {
281
- minimize: false,
281
+ minimize: Boolean(worker.config.minify) && !hot,
282
282
  emitOnErrors: false
283
283
  },
284
284
  plugins,
@@ -306,6 +306,7 @@ const OMITTED_CONFIG_KEYS = /* @__PURE__ */ new Set([
306
306
  "alias",
307
307
  "tsconfig",
308
308
  "find_additional_modules",
309
+ "minify",
309
310
  "base_dir",
310
311
  "preserve_file_names"
311
312
  ]);