@cfpreview/pages-cli
v0.0.4
Published
[Private Beta Preview] Pages CLI
Readme
[Beta] Pages CLI
$ npm install @cfpreview/pages-cli$ pages dev [directory | -- command]Examples
Create React App
$ pages dev --proxy 3000 -- npx react-scripts startA static folder
$ pages dev ./publicOptions
| Name | Description | Default |
| ---------- | ----------------------------------------------------- | ------------------------------------------------------- |
| --port | The port to listen on. | 7000 |
| --proxy | The port to proxy requests for env.ASSETS.fetch to. | Automatically determined by inspecting command process. |
| --config | The path to the beta configuration file. | ./pages-functions-beta.json |
Miniflare
Inside your pages-functions-beta.json file, you can add a "miniflare" object which is passed into the constructor of Miniflare:
{
"entryPoint": "./functions",
"baseURL": "/",
"miniflare": {
"kvPersist": true,
"kvNamespaces": ["MyKVNamespace"]
}
}You can use this to enable environment variables and secret bindings, custom build commands for single Worker setups, KV, and Durable Objects.
Note: this is only for local development and has no impact on any production settings.
Roadmap
- [ ] Improve help message (the
-- commandoption presents weirdly) - [x] Auto-configure
--proxybased on command run- [x] Testing on Windows
- [x] Bindings
- [x] Custom build scripts for single Worker setups
