Skip to content

@cloudflare/config@0.6.0

Choose a tag to compare

@workers-devprod workers-devprod released this 18 Aug 12:58
· 6 commits to main since this release
8ee43f6

Minor Changes

  • #15026 6529f0c Thanks @petebacondarwin! - Add a container option to exports.durableObject()

    Live Durable Object exports can now attach a container by name, matching the new container field in the Wrangler configuration format:

    import { defineWorker, exports } from "@cloudflare/config";
    
    export default defineWorker({
      name: "my-worker",
      compatibilityDate: "2026-07-01",
      exports: {
        MyContainerDO: exports.durableObject({
          storage: "sqlite",
          container: "my-container",
        }),
      },
    });

    Containers are only supported on the SQLite storage engine, so container is only offered alongside storage: "sqlite". Passing it with storage: "legacy-kv" is a type error rather than something only caught on deploy:

    exports.durableObject({
      storage: "legacy-kv",
      // Object literal may only specify known properties,
      // and 'container' does not exist in type '{ storage: "legacy-kv" }'
      container: "my-container",
    });

    This is an experimental feature: containers themselves are not yet configurable from cloudflare.config.ts, so the field is only useful once they are.