diff --git a/.drone.yml b/.drone.yml
index 0fef85a..b14e777 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -33,8 +33,8 @@ steps:
commands:
- yarn build
environment:
- SUBPATH: /tghandbook/${DRONE_COMMIT_BRANCH/\//_}-${DRONE_COMMIT_SHA:0:8}
- REVISION: ${DRONE_COMMIT_SHA}
+ VITE_SUBPATH: /tghandbook/${DRONE_COMMIT_BRANCH/\//_}-${DRONE_COMMIT_SHA:0:8}
+ VITE_APP_REVISION: ${DRONE_COMMIT_SHA}
when:
event:
- push
@@ -46,9 +46,9 @@ steps:
commands:
- yarn build
environment:
- SUBPATH: /tghandbook/pr-${DRONE_PULL_REQUEST}
+ VITE_SUBPATH: /tghandbook/pr-${DRONE_PULL_REQUEST}
OUTDIR: ./dist-pr
- REVISION: ${DRONE_COMMIT_SHA}
+ VITE_APP_REVISION: ${DRONE_COMMIT_SHA}
when:
event:
- pull_request
@@ -60,9 +60,9 @@ steps:
commands:
- yarn build
environment:
- SUBPATH: /tghandbook/${DRONE_COMMIT_BRANCH/\//_}
+ VITE_SUBPATH: /tghandbook/${DRONE_COMMIT_BRANCH/\//_}
OUTDIR: ./dist-branch
- REVISION: ${DRONE_COMMIT_SHA}
+ VITE_APP_REVISION: ${DRONE_COMMIT_SHA}
when:
event:
- push
diff --git a/.gitignore b/.gitignore
index 14eec95..3f41e3d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
node_modules
dist
.cache
-yarn-error.log
\ No newline at end of file
+.parcel-cache
+yarn-error.log
+*.ts.js
\ No newline at end of file
diff --git a/README.md b/README.md
index a7c256a..325e118 100644
--- a/README.md
+++ b/README.md
@@ -4,8 +4,8 @@
## Building
-`yarn build`
+`npm run build`
## Development
-`yarn dev`
+`npm start`
diff --git a/build.js b/build.js
deleted file mode 100644
index 7c449e7..0000000
--- a/build.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* eslint-disable */
-const Bundler = require("parcel-bundler");
-const Path = require("path");
-
-const entryFiles = Path.join(__dirname, "./index.html");
-
-// Bundler options
-const options = {
- outDir: process.env.OUTDIR || "./dist",
- outFile: "index.html",
- publicUrl: process.env.SUBPATH || "/",
- watch: false,
- contentHash: false,
- scopeHoist: false,
- target: "browser",
- logLevel: 3, // 5 = save everything to a file, 4 = like 3, but with timestamps and additionally log http requests to dev server, 3 = log info, warnings & errors, 2 = log warnings & errors, 1 = log errors, 0 = log nothing
- sourceMaps: true, // Enable or disable sourcemaps, defaults to enabled (minified builds currently always create sourcemaps)
- autoInstall: true, // Enable or disable auto install of missing dependencies found during bundling
-};
-
-(async () => {
- const bundler = new Bundler(entryFiles, options);
- await bundler.bundle();
-})();
diff --git a/env.d.ts b/env.d.ts
new file mode 100644
index 0000000..d07d65a
--- /dev/null
+++ b/env.d.ts
@@ -0,0 +1,10 @@
+///
+
+interface ImportMetaEnv {
+ readonly VITE_SUBDIR: string;
+ readonly VITE_APP_REVISION: string;
+}
+
+interface ImportMeta {
+ readonly env: ImportMetaEnv;
+}
diff --git a/index.html b/index.html
index 3b4ee44..088d9c8 100644
--- a/index.html
+++ b/index.html
@@ -144,9 +144,9 @@
-
+