Skip to content

Commit 6b11123

Browse files
authored
Improved README quick start (#7839)
1 parent 29f2076 commit 6b11123

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

packages/vite-plugin-cloudflare/README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,32 @@ Your Worker code runs inside [workerd](https://github.com/cloudflare/workerd), m
1616

1717
## Quick start
1818

19+
### Start with a basic `package.json`
20+
21+
```json
22+
{
23+
"name": "cloudflare-vite-quick-start",
24+
"private": true,
25+
"version": "0.0.0",
26+
"type": "module",
27+
"scripts": {
28+
"dev": "vite",
29+
"build": "vite build",
30+
"preview": "vite preview"
31+
}
32+
}
33+
```
34+
35+
> [!NOTE]
36+
> Ensure that you include `"type": "module"` in order to use ES modules by default.
37+
1938
### Install the dependencies
2039

2140
```sh
22-
npm install @cloudflare/vite-plugin wrangler --save-dev
41+
npm install vite @cloudflare/vite-plugin wrangler --save-dev
2342
```
2443

25-
### Add the plugin to your Vite config
44+
### Create your Vite config file and include the Cloudflare plugin
2645

2746
```ts
2847
// vite.config.ts
@@ -40,7 +59,7 @@ export default defineConfig({
4059
```toml
4160
# wrangler.toml
4261

43-
name = "my-worker"
62+
name = "cloudflare-vite-quick-start"
4463
compatibility_date = "2024-12-30"
4564
main = "./src/index.ts"
4665
```
@@ -57,7 +76,7 @@ export default {
5776
};
5877
```
5978

60-
You can now develop (`vite dev`), build (`vite build`), preview (`vite preview`), and deploy (`wrangler deploy`) your application.
79+
You can now develop (`npm run dev`), build (`npm run build`), preview (`npm run preview`), and deploy (`npm exec wrangler deploy`) your application.
6180

6281
## Tutorial
6382

0 commit comments

Comments
 (0)