cloudflare-next-intl 0.9.48 → 0.9.49

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.
@@ -14,10 +14,13 @@ export function getShimPath(dir = path.dirname(fileURLToPath(import.meta.url)))
14
14
  }
15
15
  export function imageOptimizerPlugin(options) {
16
16
  const resolved = resolveOptions(options);
17
+ let command = "build";
17
18
  return {
18
19
  name: "cloudflare-next-intl-image-optimizer",
19
20
  enforce: "pre",
20
- apply: resolved.dev ? undefined : "build",
21
+ configResolved(config) {
22
+ command = config.command === "serve" ? "serve" : "build";
23
+ },
21
24
  resolveId(id) {
22
25
  if (id === VIRTUAL_IMAGE_SHIM_ID) {
23
26
  return getShimPath();
@@ -53,6 +56,8 @@ export function imageOptimizerPlugin(options) {
53
56
  async buildStart() {
54
57
  if (!resolved.enabled)
55
58
  return;
59
+ if (command === "serve" && !resolved.dev)
60
+ return;
56
61
  const root = process.cwd();
57
62
  const cacheFile = path.resolve(root, resolved.cacheDir, "manifest.json");
58
63
  const entries = await run(root, resolved, cacheFile);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudflare-next-intl",
3
- "version": "0.9.48",
3
+ "version": "0.9.49",
4
4
  "description": "Optimized Next Intl Package Special for App Router and Cloudflare",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",