Skip to content

Commit c391403

Browse files
authored
Merge pull request #56 from NLnetLabs/add-build-documentation
Add documentation about the build options
2 parents 3760e51 + 74e9980 commit c391403

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@ yarn
3636
yarn build
3737
```
3838

39+
Note that small [images are inlined](https://vitejs.dev/guide/assets) in scripts
40+
or stylesheets for performance reasons.
41+
42+
The resulting `index.html` will include static assets using absolute paths.
43+
By default the assets are included from `/assets/*`. Change this path using
44+
the `--assetsDir` option, see [the build oprtions](https://vitejs.dev/guide/cli.html#options-1);
45+
46+
To change the path prefix, specify the `--base` option during a build, e.g.:
47+
48+
```sh
49+
yarn build --base /static
50+
```
51+
52+
In that case assets will be included from `/static/assets/*`,
53+
but the output directory structure wil not change.
54+
See [the documentation on base](https://vitejs.dev/config/shared-options.html#base);
55+
3956
## Linting
4057

4158
```sh

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"version": "0.0.1",
55
"type": "module",
66
"scripts": {
7-
"dev": "vite",
8-
"build": "tsc && vite build --outDir public",
7+
"dev": "ROTO_API_HOST=https://rest.bgp-api.net ROUTINATOR_API_HOST=https://routinator.do.nlnetlabs.nl vite",
8+
"build": "tsc && vite build --outDir public --mode production",
99
"lint": "eslint && tsc --noEmit",
1010
"format": "prettier --write \"**/*.(ts|tsx|css)\"",
1111
"test": "jest"

0 commit comments

Comments
 (0)