Skip to content

Commit 99c8b8b

Browse files
authored
Merge pull request conwnet#50 from xcv58/vercel
Add Vercel support
2 parents 96889d1 + 53b5a8e commit 99c8b8b

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"typescript": "^4.1.3"
2121
},
2222
"scripts": {
23+
"preinstall": "./scripts/pre-install.sh",
2324
"postinstall": "husky install && ./scripts/postinstall.sh",
2425
"clean-build": "./scripts/clean-build.sh",
2526
"clean": "./scripts/clean.sh",

scripts/pre-install.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
set -eo pipefail
3+
4+
cd "$(dirname "${0}")/.."
5+
APP_ROOT=$(pwd)
6+
7+
# execute all necessary tasks
8+
function main() {
9+
if [ "$VERCEL" = 1 ]; then
10+
echo "On Vercel"
11+
yum groupinstall "Development Tools"
12+
yum install libX11-devel.x86_64 libxkbfile-devel.x86_64 libsecret-devel rsync
13+
fi
14+
}
15+
16+
main "$@"

vercel.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"routes": [{
3+
"src": "/static/(.*)",
4+
"dest": "/images/$1"
5+
},
6+
{
7+
"src": "/favicon.ico",
8+
"dest": "/favicon.ico"
9+
},
10+
{
11+
"src": "/manifest.json",
12+
"dest": "/manifest.json"
13+
},
14+
{
15+
"src": ".*",
16+
"dest": "/index.html"
17+
}
18+
]
19+
}

0 commit comments

Comments
 (0)