ap32
ap32
SSolidJS
Created by ap32 on 3/19/2024 in #support
Hmr doesn't work with custom port
Everything works fine when I use default hmr settings. But it stops working when I configure the port.
import { defineConfig } from "@solidjs/start/config";
import UnoCSS from "unocss/vite";

export default defineConfig({
vite: {
server: {
port: 3000,
strictPort: true,
hmr: {
port: 64314
}
// hmr: {
// protocol: "wss",
// port: 22300,
// clientPort: 443,
// path: "hmr/"
// },
},
plugins: [UnoCSS()],
},
});
import { defineConfig } from "@solidjs/start/config";
import UnoCSS from "unocss/vite";

export default defineConfig({
vite: {
server: {
port: 3000,
strictPort: true,
hmr: {
port: 64314
}
// hmr: {
// protocol: "wss",
// port: 22300,
// clientPort: 443,
// path: "hmr/"
// },
},
plugins: [UnoCSS()],
},
});
It also writes Websocket socket error:
vinxi v0.3.10
vinxi starting dev server
WebSocket server error: Port is already in use
WebSocket server error: Port is already in use (x2)

➜ Local: http://localhost:3000/
➜ Network: use --host to expose
vinxi v0.3.10
vinxi starting dev server
WebSocket server error: Port is already in use
WebSocket server error: Port is already in use (x2)

➜ Local: http://localhost:3000/
➜ Network: use --host to expose
I need this to be able to work with code in a docker container
2 replies
SSolidJS
Created by ap32 on 3/18/2024 in #support
How to add babel plugin into new configuration?
Some time ago i created small code transformer using babel https://github.com/ap32/sample-site-finsweet-cft-12/blob/main/macro/join/index.ts#L21 I made it for simpler multiline classes editing (tailwind, unocss). $join('foo', 'bar') will become foo bar, $join(a, b, ...c) will become ${a} ${b} ${[...c].join(' ')} and so on. I was able to add it like that https://github.com/ap32/sample-site-finsweet-cft-12/blob/main/vite.config.ts#L20, but i don't know how to do that in new configuration. Another question, will you still use babel for https://github.com/ryansolid/dom-expressions in the future?
5 replies