add static generation (WIP)

This commit is contained in:
dennis.ludwig
2021-06-10 16:50:51 +02:00
parent 001e26a2cd
commit 02c81de12e
3 changed files with 25 additions and 7 deletions

1
.env Normal file
View File

@@ -0,0 +1 @@
PUBLIC_URL=techradar/

View File

@@ -39,8 +39,24 @@ Serve
cd build cd build
python3 -m http.server 8080 python3 -m http.server 8080
``` ```
Then open here: http://localhost:8080 Then open here: http://localhost:8080
## Run a prepared static version
In most cases you have the techradar available at `/techradar`, and for reasons want all correct pages to be accessable.
Until this setup improves, you can use the following way to generate the correct techradar:
```
yarn generateJson
PUBLIC_URL=techradar/ yarn buildRadar
yarn createStaticFiles
cp -r build techradar
```
(This is rather workaroundish for now, but does the job.)
## Usage ## Usage
For a new Technology Radar release, create a folder of the release date For a new Technology Radar release, create a folder of the release date
@@ -83,9 +99,9 @@ merged with the old ones and a new history entry is created for that item.
## Open points ## Open points
* static build necessary? * static build necessary? -> for SEO necessary
* measure file sizes necessary? * dotenv necessary? -> Could be necessary for other companies
* dotenv necessary? * measure file sizes necessary? -> no
* check browsers necessary? * check browsers necessary? -> no
* copy public folder necessary? * copy public folder necessary? -> no
* specific webpack configurations necessary? * specific webpack configurations necessary? -> no

View File

@@ -11,7 +11,8 @@
}, },
"bin": { "bin": {
"generateJson": "scripts/generateJson.js", "generateJson": "scripts/generateJson.js",
"buildRadar": "scripts/buildRadar.js" "buildRadar": "scripts/buildRadar.js",
"createStaticFiles": "bin/tasks/create-static.js"
}, },
"scripts": { "scripts": {
"prepare": "husky install && yarn build:tasks && yarn build", "prepare": "husky install && yarn build:tasks && yarn build",