File tree Expand file tree Collapse file tree 3 files changed +45
-23
lines changed Expand file tree Collapse file tree 3 files changed +45
-23
lines changed Original file line number Diff line number Diff line change
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
+ ```
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 20
20
- " Running the Application " : v1/installation/running-the-application.md
21
21
- " FAQ " : v1/installation/faq.md
22
22
- How to :
23
- - " Use NPM Commands " : v1/how-tos/npm-commands .md
23
+ - " Bundle Static Modules " : v1/how-tos/bundle-static-modules .md
24
24
- " Routing " : v1/how-tos/routing.md
25
25
- " Create Pages " : v1/how-tos/create-pages.md
26
26
- " Set Up Twitter and OpenGraph Cards " : v1/how-tos/twitter-opengraph-cards.md
You can’t perform that action at this time.
0 commit comments