blob: db47b2968eb6063931be6d26e2ebec36dc37e86e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
---
layout: ../../layouts/content.astro
title: Quick Start
description: A very basic guide for developers who want to run Snowpack as quickly as possible.
---
### Install Snowpack
```bash
# npm:
npm install --save-dev snowpack
# yarn:
yarn add --dev snowpack
# pnpm:
pnpm add --save-dev snowpack
```
### Run the Snowpack CLI
```bash
npx snowpack [command]
yarn run snowpack [command]
pnpm run snowpack [command]
```
Throughout our documentation, we'll use `snowpack [command]` to document the CLI. To run your locally installed version of Snowpack, add the `npx`/`yarn run`/`pnpm run` prefix of the package manager that you used to install Snowpack.
For long-term development, the best way to use Snowpack is with a package.json script. This reduces your own need to remember exact Snowpack commands/configuration, and lets you share some common scripts with the rest of your team (if applicable).
```js
// Recommended: package.json scripts
// npm start (or: "yarn run ...", "pnpm run ...")
"scripts": {
"start": "snowpack dev",
"build": "snowpack build"
}
```
### Serve your project locally
```
snowpack dev
```
This starts the local dev server for development. By default this serves your current working directory to the browser, and will look for an `index.html` file to start. You can customize which directories you want to serve via the ["mount"](/reference/configuration) configuration.
### Build your project
```
snowpack build
```
This builds your project into a static `build/` directory that you can deploy anywhere. You can customize your build via [configuration](/reference/configuration).
### See all commands & options
```
snowpack --help
```
The `--help` flag will display helpful output.
|