Skip to content

Commit

Permalink
revert configs back to working versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Apr 18, 2024
1 parent 9b9628e commit 88946de
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 56 deletions.
19 changes: 7 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "myrelay.site",
"type": "module",
"version": "0.2.0",
"version": "0.1.1",
"main": "index.js",
"repository": "[email protected]:sandwichfarm/myrelay.site.git",
"author": "dskvr <[email protected]>",
"license": "MIT",
"scripts": {
"dev": "vite dev",
"build": "pnpm prepare && vite build",
"prepare": "pnpm build:themes",
"build": "yarn prepare && vite build",
"prepare": "yarn build:themes",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
Expand Down Expand Up @@ -40,7 +40,6 @@
"nostr-zap": "0.22.0",
"object-hash": "3.0.0",
"paneforge": "0.0.2",
"postcss-import": "16.1.0",
"promise-deferred": "2.0.4",
"svelte": "4.2.12",
"svelte-geolocation": "0.3.0",
Expand All @@ -55,7 +54,8 @@
"tailwind-variants": "0.2.1",
"tseep": "1.2.1",
"vaul-svelte": "0.3.0",
"vite": "5.2.9",
"vite-plugin-mkcert": "1.17.5",
"vitest": "1.4.0",
"zod": "3.22.4"
},
"devDependencies": {
Expand All @@ -72,11 +72,6 @@
"svelte-check": "3.6.9",
"tailwindcss": "^3.3.6",
"typescript": "5.4.3",
"vite-plugin-dynamic-import": "1.5.0",
"vite-plugin-mkcert": "1.17.5",
"vitest": "1.4.0"
},
"engines": {
"node": ">=18.0.0"
"vite-plugin-dynamic-import": "1.5.0"
}
}
}
29 changes: 3 additions & 26 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { sveltekit } from "@sveltejs/kit/vite";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
import adapter from "@sveltejs/adapter-static";
import preprocess from "svelte-preprocess";
Expand All @@ -24,30 +23,8 @@ export default {
files: () => ["src/service-worker.js"],
},
alias: {
"$lib": "./src/lib",
"$lib/*": "./src/lib/*",
$lib: "./src/lib",
"@/*": "./src/lib"
},
},
vite: {
// server: {
// headers: {
// 'Cross-Origin-Opener-Policy': 'unsafe-none',
// 'Cross-Origin-Embedder-Policy': 'unsafe-none',
// 'Cross-Origin-Resource-Policy': "cross-site"
// }
// },
plugins: [sveltekit()],
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('node_modules')) {
return 'vendor'; // Split vendor code
}
}
}
}
}
}
};
},
};
34 changes: 16 additions & 18 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,29 @@ import mkcert from 'vite-plugin-mkcert'
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';


const file = fileURLToPath(new URL('package.json', import.meta.url)),
json = readFileSync(file, 'utf8'),
pkg = JSON.parse(json);


// /** @type {import('vite').Plugin} */
// const viteServerConfig = {
// name: 'log-request-middleware',
// configureServer(server) {
// server.middlewares.use((req, res, next) => {
// res.setHeader("Access-Control-Allow-Origin", "*");
// res.setHeader("Access-Control-Allow-Methods", "GET");
// res.setHeader("Cross-Origin-Opener-Policy", "cross-origin");
// res.setHeader("Cross-Origin-Embedder-Policy", "unsafe-none");
// res.setHeader("Cross-Origin-Resource-Policy", "cross-origin");
// next();
// });
// }
// };
/** @type {import('vite').Plugin} */
const viteServerConfig = {
name: 'log-request-middleware',
configureServer(server) {
server.middlewares.use((req, res, next) => {
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Methods", "GET");
res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
next();
});
}
};

export default defineConfig({
plugins: [
sveltekit(),
mkcert(),
// viteServerConfig
viteServerConfig
],
test: {
include: ["src/**/*.{test,spec}.{js,ts}"],
Expand All @@ -38,5 +35,6 @@ export default defineConfig({
version: {
value: pkg.version,
}
}
},
debug: true
});

0 comments on commit 88946de

Please sign in to comment.