|
4 | 4 |
|
5 | 5 | Your friendly tuner done in svelte with typescript and comlink. |
6 | 6 |
|
7 | | - |
8 | | -## Get started |
9 | | - |
10 | | -Install the dependencies... |
11 | | - |
12 | | -```bash |
13 | | -cd svelte-app |
14 | | -npm install |
15 | | -``` |
16 | | - |
17 | | -...then start [Rollup](https://rollupjs.org): |
18 | | - |
19 | | -```bash |
20 | | -npm run dev |
21 | | -``` |
22 | | - |
23 | | -Navigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes. |
24 | | - |
25 | | -By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`. |
26 | | - |
27 | | - |
28 | | -## Building and running in production mode |
29 | | - |
30 | | -To create an optimised version of the app: |
31 | | - |
32 | | -```bash |
33 | | -npm run build |
34 | | -``` |
35 | | - |
36 | | -You can run the newly built app with `npm run start`. This uses [sirv](https://github.com/lukeed/sirv), which is included in your package.json's `dependencies` so that the app will work when you deploy to platforms like [Heroku](https://heroku.com). |
37 | | - |
38 | | - |
39 | | -## Single-page app mode |
40 | | - |
41 | | -By default, sirv will only respond to requests that match files in `public`. This is to maximise compatibility with static fileservers, allowing you to deploy your app anywhere. |
42 | | - |
43 | | -If you're building a single-page app (SPA) with multiple routes, sirv needs to be able to respond to requests for *any* path. You can make it so by editing the `"start"` command in package.json: |
44 | | - |
45 | | -```js |
46 | | -"start": "sirv public --single" |
47 | | -``` |
48 | | - |
49 | | -## Using TypeScript |
50 | | - |
51 | | -This template comes with a script to set up a TypeScript development environment, you can run it immediately after cloning the template with: |
52 | | - |
53 | | -```bash |
54 | | -node scripts/setupTypeScript.js |
55 | | -``` |
56 | | - |
57 | | -Or remove the script via: |
58 | | - |
59 | | -```bash |
60 | | -rm scripts/setupTypeScript.js |
61 | | -``` |
62 | | - |
63 | | -## Deploying to the web |
64 | | - |
65 | | -### With [Vercel](https://vercel.com) |
66 | | - |
67 | | -Install `vercel` if you haven't already: |
68 | | - |
69 | | -```bash |
70 | | -npm install -g vercel |
71 | | -``` |
72 | | - |
73 | | -Then, from within your project folder: |
74 | | - |
75 | | -```bash |
76 | | -cd public |
77 | | -vercel deploy --name my-project |
78 | | -``` |
79 | | - |
80 | | -### With [surge](https://surge.sh/) |
81 | | - |
82 | | -Install `surge` if you haven't already: |
83 | | - |
84 | | -```bash |
85 | | -npm install -g surge |
86 | | -``` |
87 | | - |
88 | | -Then, from within your project folder: |
89 | | - |
90 | | -```bash |
91 | | -npm run build |
92 | | -surge public my-project.surge.sh |
93 | | -``` |
| 7 | +*FYI: recently moved from rollup to vite setup* |
0 commit comments