Skip to content

Commit dc82ff3

Browse files
authored
Merge pull request #19 from dotkernel/vite
Vite page
2 parents 117b1c6 + b93737d commit dc82ff3

File tree

3 files changed

+45
-23
lines changed

3 files changed

+45
-23
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Bundle Static Modules
2+
3+
> Prerequisite software: Node.js v20 (minimum supported version)
4+
5+
[Vite](https://vite.dev/) is a frontend dev tool we use:
6+
7+
- To avoid network bottlenecks that can occur when your application has a lot of separate scripts and style sheets.
8+
- To concatenate and compress (uglify) `.css` and `.js` files
9+
- To preprocess `.scss` files into `.css`.
10+
- To copy the `fonts` and `images` used in your project, from the `assets` folder to the `public` folder.
11+
12+
First you need to install dependencies into the `node_modules` directory by running this command:
13+
14+
```shell
15+
npm install
16+
```
17+
18+
If everything ran ok, you should see a new root folder named `node_modules` where all the npm packages are installed.
19+
If `npm install` fails, this could be caused by user permissions for npm.
20+
Our recommendation is to install npm through `Node Version Manager`.
21+
22+
The `watch` command compiles the components then monitors the source files and triggers their recompilation when one of them is changed:
23+
24+
```shell
25+
npm run watch
26+
```
27+
28+
Initially, Vite is configured to delete and rebuild the contents of these folders from the `public` folder:
29+
30+
- css
31+
- fonts
32+
- images
33+
- js
34+
35+
The folders are populated from their counterparts in `src/App/assets`.
36+
37+
> Make sure to not edit anything inside the four public folders manually.
38+
> Other files and folders in the public folder will be left as is.
39+
40+
An alternative to the `watch` command is `build` which simply compiles the components, overwriting as needed:
41+
42+
```shell
43+
npm run build
44+
```

docs/book/v1/how-tos/npm-commands.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ nav:
2020
- "Running the Application": v1/installation/running-the-application.md
2121
- "FAQ": v1/installation/faq.md
2222
- How to:
23-
- "Use NPM Commands": v1/how-tos/npm-commands.md
23+
- "Bundle Static Modules": v1/how-tos/bundle-static-modules.md
2424
- "Routing": v1/how-tos/routing.md
2525
- "Create Pages": v1/how-tos/create-pages.md
2626
- "Set Up Twitter and OpenGraph Cards": v1/how-tos/twitter-opengraph-cards.md

0 commit comments

Comments
 (0)