From f9aeaddf525f82b51fe08445f8ca3426e8e36cd1 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sun, 26 Jun 2022 13:22:33 +0300 Subject: [PATCH] refactor(es modules): deploy setup --- deploy.sh | 17 +++++++++++++++++ src/utils/numberUtils.ts | 4 +--- vite.config.js | 4 +++- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 00000000..90d6aac7 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env sh + +# abort on errors +set -e + +npm run build + +cd dist + +git init +git checkout -b master +git add -A +git commit -m 'deploy' + +git push -f git@github.com:Azgaar/Fantasy-Map-Generator.git main:gh-pages + +cd - diff --git a/src/utils/numberUtils.ts b/src/utils/numberUtils.ts index b4a67410..8bdebc1f 100644 --- a/src/utils/numberUtils.ts +++ b/src/utils/numberUtils.ts @@ -1,4 +1,4 @@ -// round value to d decimals +// round value to n decimals export function rn(value: number, decimals: number = 0) { const multiplier = Math.pow(10, decimals); return Math.round(value * multiplier) / multiplier; @@ -17,5 +17,3 @@ export function lim(value: number) { export function normalize(val: number, min: number, max: number) { return minmax((val - min) / (max - min), 0, 1); } - -// import {rn, minmax, lim, normalize} from '/src/utils/numberUtils'; diff --git a/vite.config.js b/vite.config.js index 4bc7d407..c8a5db6c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,3 +1,5 @@ import {defineConfig} from "vite"; -export default defineConfig({}); +export default defineConfig({ + base: "/Fantasy-Map-Generator/" +});