-
Notifications
You must be signed in to change notification settings - Fork 6.3k
-
So, I am using astro & vite for a website, I ran pnpm dev
and it seems like it's still showing the error.
The current config I have is
import { execSync } from 'child_process';
import node from '@astrojs/node';
import tailwind from '@astrojs/tailwind';
import { baremuxPath } from '@mercuryworkshop/bare-mux/node';
import { epoxyPath } from '@mercuryworkshop/epoxy-transport';
import { scramjetPath } from '@mercuryworkshop/scramjet';
import { server as wisp } from '@mercuryworkshop/wisp-js/server';
import playformCompress from '@playform/compress';
import { defineConfig } from 'astro/config';
import { normalizePath } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import { version } from './package.json';
export default defineConfig({
output: 'static',
adapter: node({ mode: 'middleware' }),
server: {
port: 4321,
},
base: '/absproxy/4321',
integrations: [
tailwind(),
playformCompress({
CSS: false,
HTML: true,
Image: true,
JavaScript: true,
SVG: true,
}),
],
prefetch: {
prefetchAll: false,
defaultStrategy: 'viewport',
},
vite: {
define: {
VERSION: JSON.stringify(version),
LAST_UPDATED: JSON.stringify(check()),
},
plugins: [
{
name: 'viteserver',
configureServer(server) {
server.httpServer?.on('upgrade', (req, socket, head) => {
if (req.url?.startsWith('/wsp/')) {
wisp.routeRequest(req, socket, head);
}
});
},
},
viteStaticCopy({
targets: [
{
src: normalizePath(epoxyPath + '/**/*.mjs'),
dest: 'assets/packaged/ep',
overwrite: false,
},
{
src: normalizePath(baremuxPath + '/**/*.js'),
dest: 'assets/packaged/bm',
overwrite: false,
},
{
src: `${scramjetPath}/**/*.js`.replace(/\\/g, '/'),
dest: 'assets/packaged/scram',
overwrite: false,
rename: (name) => `${name.replace('scramjet.', '')}.js`,
},
],
}),
],
},
});
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Is this a question for code-server or for the Vite folks? 0.0.0.0:4321 would imply you are hitting the port directly, without involving code-server.
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment