From 6d995597680bb267bec53841a0128a4a47d4fcf8 Mon Sep 17 00:00:00 2001
From: rift <117926989+Riftriot@users.noreply.github.com>
Date: Thu, 21 Dec 2023 11:43:40 -0600
Subject: [PATCH] Revert "Add Dynamic Support"
This reverts commit e74459ecb92635b3e938b67698bf309dd36a998b.
---
index.html | 5 -----
package.json | 3 +--
public/dynamic/dynamic.config.js | 28 ----------------------------
public/dynsw.js | 19 -------------------
public/sw.js | 2 ++
vite.config.ts | 7 +------
6 files changed, 4 insertions(+), 60 deletions(-)
delete mode 100644 public/dynamic/dynamic.config.js
delete mode 100644 public/dynsw.js
diff --git a/index.html b/index.html
index f49fe99..b02bfc0 100644
--- a/index.html
+++ b/index.html
@@ -8,17 +8,12 @@
Nebula
-
-
diff --git a/package.json b/package.json
index 321f6f9..90f2215 100644
--- a/package.json
+++ b/package.json
@@ -27,8 +27,7 @@
"react-helmet": "^6.1.0",
"react-i18next": "^13.5.0",
"react-icons": "^4.12.0",
- "tsx": "^4.7.0",
- "dynamic-npm": "github:notplayingallday383/dynamic-npm"
+ "tsx": "^4.7.0"
},
"devDependencies": {
"@preact/preset-vite": "^2.5.0",
diff --git a/public/dynamic/dynamic.config.js b/public/dynamic/dynamic.config.js
deleted file mode 100644
index 132c571..0000000
--- a/public/dynamic/dynamic.config.js
+++ /dev/null
@@ -1,28 +0,0 @@
-self.__dynamic$config = {
- prefix: '/dyn/',
- encoding: 'xor',
- mode: 'production',
- logLevel: 0,
- bare: {
- version: 3,
- path: '/bare/',
- },
- tab: {
- title: 'Service',
- icon: null,
- ua: null,
- },
- assets: {
- prefix: '/dynamic/',
- files: {
- handler: 'dynamic.handler.js',
- client: 'dynamic.client.js',
- worker: 'dynamic.worker.js',
- config: 'dynamic.config.js',
- inject: null,
- }
- },
- block: [
-
- ]
-};
\ No newline at end of file
diff --git a/public/dynsw.js b/public/dynsw.js
deleted file mode 100644
index 0260d8c..0000000
--- a/public/dynsw.js
+++ /dev/null
@@ -1,19 +0,0 @@
-importScripts('/dynamic/dynamic.config.js');
-importScripts('/dynamic/dynamic.worker.js');
-
-const sw = new UVServiceWorker();
-const dynamic = new Dynamic();
-self.dynamic = dynamic;
-self.addEventListener('fetch',
- event => {
- event.respondWith(
- (async function() {
- if (await dynamic.route(event)) {
- return await dynamic.fetch(event);
- }
-
- return await fetch(event.request);
- })()
- );
- }
-);
\ No newline at end of file
diff --git a/public/sw.js b/public/sw.js
index 0df4b72..3082bb9 100644
--- a/public/sw.js
+++ b/public/sw.js
@@ -2,4 +2,6 @@ importScripts("/uv/uv.bundle.js");
importScripts("/uv/uv.config.js");
importScripts(__uv$config.sw || "/uv/uv.sw.js");
+const sw = new UVServiceWorker();
+
self.addEventListener("fetch", (event) => event.respondWith(sw.fetch(event)));
diff --git a/vite.config.ts b/vite.config.ts
index 7a14077..e04660d 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -3,21 +3,16 @@ import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
import { viteStaticCopy } from "vite-plugin-static-copy";
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
-import { dynPath } from "dynamic-npm";
export default defineConfig({
plugins: [
viteStaticCopy({
targets: [
{
+ // .replace fixes weird paths on Windows
src: `${uvPath}/uv.*.js`.replace(/\\/g, "/"),
dest: "uv",
overwrite: false
- },
- {
- src: `${dynPath}/dynamic.*.js`.replace(/\\/g, "/"),
- dest: "dynamic",
- overwrite: false
}
]
}),