You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this section we will introduce how to scaffold a Vue [Single Page Application](/guide/extras/ways-of-using-vue#single-page-application-spa) on your local machine. The created project will be using a build setup based on [Vite](https://vitejs.dev) and allow us to use Vue [Single-File Components](/guide/scaling-up/sfc) (SFCs).
24
28
25
-
Make sure you have an up-to-date version of [Node.js](https://nodejs.org/) installed and your current working directory is the one where you intend to create a project. Run the following command in your command line (without the `>` sign):
29
+
Make sure you have an up-to-date version of [Node.js](https://nodejs.org/) installed and your current working directory is the one where you intend to create a project. Run the following command in your command line (without the `$` sign):
This command will install and execute [create-vue](https://github.com/vuejs/create-vue), the official Vue project scaffolding tool. You will be presented with prompts for several optional features such as TypeScript and testing support:
30
63
@@ -43,10 +76,44 @@ This command will install and execute [create-vue](https://github.com/vuejs/crea
43
76
44
77
If you are unsure about an option, simply choose `No` by hitting enter for now. Once the project is created, follow the instructions to install dependencies and start the dev server:
<spanclass="line"><spanstyle="color:var(--vt-c-green);">> </span><spanstyle="color:#A6ACCD;">npm run dev</span></span>
49
-
<spanclass="line"></span></code></pre></div>
79
+
<VTCodeGroup>
80
+
<VTCodeGroupTablabel="npm">
81
+
82
+
```sh
83
+
$ cd<your-project-name>
84
+
$ npm install
85
+
$ npm run dev
86
+
```
87
+
88
+
</VTCodeGroupTab>
89
+
<VTCodeGroupTablabel="pnpm">
90
+
91
+
```sh
92
+
$ cd<your-project-name>
93
+
$ pnpm install
94
+
$ pnpm run dev
95
+
```
96
+
97
+
</VTCodeGroupTab>
98
+
<VTCodeGroupTablabel="yarn">
99
+
100
+
```sh
101
+
$ cd<your-project-name>
102
+
$ yarn
103
+
$ yarn dev
104
+
```
105
+
106
+
</VTCodeGroupTab>
107
+
<VTCodeGroupTablabel="bun">
108
+
109
+
```sh
110
+
$ cd<your-project-name>
111
+
$ bun install
112
+
$ bun run dev
113
+
```
114
+
115
+
</VTCodeGroupTab>
116
+
</VTCodeGroup>
50
117
51
118
You should now have your first Vue project running! Note that the example components in the generated project are written using the [Composition API](/guide/introduction#composition-api) and `<script setup>`, rather than the [Options API](/guide/introduction#options-api). Here are some additional tips:
52
119
@@ -57,8 +124,36 @@ You should now have your first Vue project running! Note that the example compon
57
124
58
125
When you are ready to ship your app to production, run the following:
59
126
60
-
<divclass="language-sh"><pre><code><spanclass="line"><spanstyle="color:var(--vt-c-green);">> </span><spanstyle="color:#A6ACCD;">npm run build</span></span>
61
-
<spanclass="line"></span></code></pre></div>
127
+
<VTCodeGroup>
128
+
<VTCodeGroupTablabel="npm">
129
+
130
+
```sh
131
+
$ npm run build
132
+
```
133
+
134
+
</VTCodeGroupTab>
135
+
<VTCodeGroupTablabel="pnpm">
136
+
137
+
```sh
138
+
$ pnpm run build
139
+
```
140
+
141
+
</VTCodeGroupTab>
142
+
<VTCodeGroupTablabel="yarn">
143
+
144
+
```sh
145
+
$ yarn build
146
+
```
147
+
148
+
</VTCodeGroupTab>
149
+
<VTCodeGroupTablabel="bun">
150
+
151
+
```sh
152
+
$ bun run build
153
+
```
154
+
155
+
</VTCodeGroupTab>
156
+
</VTCodeGroup>
62
157
63
158
This will create a production-ready build of your app in the project's `./dist` directory. Check out the [Production Deployment Guide](/guide/best-practices/production-deployment) to learn more about shipping your app to production.
0 commit comments