mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-12 22:00:02 -04:00
VITE_ADRIFT_CDN
This commit is contained in:
parent
541ed3be82
commit
f50640a642
5 changed files with 13 additions and 7 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,8 @@
|
||||||
|
if (import.meta.env.VITE_ADRIFT_CDN && import.meta.env.VITE_ADRIFT_SINGLEFILE) {
|
||||||
|
document.body.innerHTML = `<link rel='stylesheet' href='https://cdn.jsdelivr.net/gh/adriftnet/static/index-861d7b8d.css' /> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Cabin"><div id='app' />`;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
import { registerRemoteListener } from "bare-client-custom";
|
import { registerRemoteListener } from "bare-client-custom";
|
||||||
import App from "./App.svelte";
|
import App from "./App.svelte";
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ export default defineConfig({
|
||||||
svelte({
|
svelte({
|
||||||
|
|
||||||
}),
|
}),
|
||||||
process.env.VITE_ADRIFT_SINGLEFILE && viteSingleFile()
|
(process.env.VITE_ADRIFT_SINGLEFILE && !process.env.VITE_ADRIFT_CDN) && viteSingleFile()
|
||||||
],
|
],
|
||||||
build: {
|
build: {
|
||||||
dev: true,
|
dev: true,
|
||||||
|
|
|
@ -28,7 +28,6 @@ export class BareError extends Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setServers(["1.1.1.3", "1.0.0.3"]);
|
|
||||||
export const options: BareServerOptions = {
|
export const options: BareServerOptions = {
|
||||||
logErrors: true,
|
logErrors: true,
|
||||||
filterRemote: (url) => {
|
filterRemote: (url) => {
|
||||||
|
@ -37,7 +36,8 @@ export const options: BareServerOptions = {
|
||||||
if (isValid(url.hostname) && parse(url.hostname).range() !== "unicast")
|
if (isValid(url.hostname) && parse(url.hostname).range() !== "unicast")
|
||||||
throw new RangeError("Forbidden IP");
|
throw new RangeError("Forbidden IP");
|
||||||
},
|
},
|
||||||
lookup: (hostname, options, callback) =>
|
lookup: (hostname, options, callback) => {
|
||||||
|
setServers(["1.1.1.3", "1.0.0.3"]);
|
||||||
|
|
||||||
lookup(hostname, options, (err: any, address: any, family: any) => {
|
lookup(hostname, options, (err: any, address: any, family: any) => {
|
||||||
if (
|
if (
|
||||||
|
@ -48,7 +48,8 @@ export const options: BareServerOptions = {
|
||||||
)
|
)
|
||||||
callback(new RangeError("Forbidden IP"), [], -1);
|
callback(new RangeError("Forbidden IP"), [], -1);
|
||||||
else callback(err, address, family);
|
else callback(err, address, family);
|
||||||
}),
|
})
|
||||||
|
},
|
||||||
httpAgent: new HTTPAgent({
|
httpAgent: new HTTPAgent({
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue