Skip to content

Commit ee37c6f

Browse files
committed
Add documentation about the frontend build system
1 parent e5677b7 commit ee37c6f

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

site/frontend/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `rustc-perf` site frontend
22
This directory contains code for the `rustc-perf` website frontend.
33

4-
## Build
4+
## Build instructions
55
- Install dependencies
66
```console
77
$ npm install
@@ -17,3 +17,12 @@ This directory contains code for the `rustc-perf` website frontend.
1717

1818
The files are packaged into the `dist` directory, from which they are embedded into the `rustc-perf`
1919
binary.
20+
21+
## Build system
22+
The frontend is built using the `Parcel` bundler. It generates several JavaScript files (one for each
23+
page in the perf.RLO website) into the `dist` directory.
24+
25+
It uses a custom backend for transpiling `TypeScript`, which transpiles for browsers defined in
26+
the `browserslist` attribute in `package.json`. It does not perform type-checking, that is why
27+
there is a dedicated `npm run check` action that uses `tsc`. It is performed on CI to find typ errors.
28+
The `tsconfig.json` file is only used by the type-checking action.

site/frontend/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@
2626
"source": "src/pages/dashboard.ts",
2727
"distDir": "dist/scripts"
2828
}
29-
}
29+
},
30+
"browserslist": "> 0.5%, last 3 years, not dead"
3031
}

site/frontend/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"compilerOptions": {
33
"lib": ["es5", "es2015", "dom"],
4-
"target": "es5",
4+
"target": "es2017",
5+
"moduleResolution": "node",
56
"rootDir": "src"
67
}
78
}

0 commit comments

Comments
 (0)