wayBetter for X

This commit is contained in:
CRTkafa 2026-10-01 06:01:13 +07:00
commit df5dff619e
720 changed files with 147465 additions and 0 deletions

View file

@ -0,0 +1,30 @@
import { defineConfig, type Plugin } from 'vite';
import react from '@vitejs/plugin-react';
import { bootScript } from '../../waybetter/packages/shell/src/frame/boot.ts';
/** `/boot.js` (index.html): the shell's first-frame script, generated by the wayBetter shell frame. */
function wayBetterBoot(): Plugin {
return {
name: 'waybetter-boot',
configureServer(server) {
server.middlewares.use('/boot.js', (_request, response) => {
response.setHeader('Content-Type', 'text/javascript; charset=utf-8');
response.end(bootScript());
});
},
generateBundle() {
this.emitFile({ type: 'asset', fileName: 'boot.js', source: bootScript() });
},
};
}
export default defineConfig({
plugins: [react(), wayBetterBoot()],
// The shell frame lives in the framework checkout (waybetter/): its imports of these resolve to
// this app's copies, so there is one React and one dockview.
resolve: { dedupe: ['react', 'react-dom', 'dockview', '@tauri-apps/api', 'acorn'] },
clearScreen: false,
server: { host: '127.0.0.1', port: 1420, strictPort: true, watch: { ignored: ['**/src-tauri/**'] } },
preview: { host: '127.0.0.1', port: 1421, strictPort: true },
build: { target: ['es2022'], sourcemap: false },
});