Skip to content

wrangler publish #2

@threepointone

Description

@threepointone

This is the parent issue tracking the implementation of wrangler publish.

Usage

In it's simplest form, you can write a worker, say at index.js, and run: wrangler publish index.js --name myscriptname, and -

  • it'll 'bundle' your script into a single file, and publish it to myscriptname.<your subdomain>.workers.dev
  • Much like wrangler dev, we aim to provide a default experience that's immediately useful, so you shouldn't have to setup a bundler/compiler for most usecases. So, you can use modules from npm, create separate modules, use react (todo: --jsx <reference> for other libraries), use typescript, and it should all Just Work. (more details on the tracking issue for wrangler dev)
  • Much like wrangler dev, wrangler publish will also automatically infer whether your script is in the service-worker format or the newer ES modules format.
  • You can publish to your own domain/zone with wrangler publish <script> --name <name> --zone somedomain.com --route "somedomain.com/path/*"
    • You'll note that you can pass a domain directly to zone, instead of a zone_id. wrangler publish should work with both forms of configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions