Skip to content

Commit

Permalink
remove config
Browse files Browse the repository at this point in the history
  • Loading branch information
Syuparn committed Feb 24, 2024
1 parent 1065b1e commit 242c8cd
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// NOTE: for security reason, SharedArrayBuffer(, which is required for wasm runtime) cannot run without these headers!
const crossOriginPolicy = {
name: "configure-server",

configureServer(server) {
server.middlewares.use((_req, res, next) => {
res.setHeader("Cross-Origin-Opener-Policy", "same-origin")
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp")
next()
})
},
}

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), crossOriginPolicy],
plugins: [react()],
// HACK: fix link path because endpoint of GitHub pages is https://syuparn.github.io/onylox/ (not root)
base: process.env.GITHUB_PAGES
? 'onylox'
Expand Down

0 comments on commit 242c8cd

Please sign in to comment.