engine moved to a separate node.js module

This commit is contained in:
azykov@mail.ru
2026-09-04 13:10:47 +03:00
parent f4c1eedf62
commit f56e79ee94
27 changed files with 331 additions and 786 deletions
+23
View File
@@ -1,6 +1,29 @@
import { fileURLToPath } from 'node:url';
import path from 'node:path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
const rootDir = path.dirname(fileURLToPath(import.meta.url));
const engineDir = path.resolve(rootDir, '../engine');
export default defineConfig({
plugins: [react()],
resolve: {
// Follow the node_modules symlink to the real sibling directory, so Vite's dev server
// watches and transforms the actual engine source files (not a frozen pre-bundled copy).
preserveSymlinks: false,
},
optimizeDeps: {
// Treat @incgame/engine as first-party source, not a vendor dependency to pre-bundle once
// and cache — otherwise edits to the engine package wouldn't trigger HMR until a full
// dev-server restart.
exclude: ['@incgame/engine'],
},
server: {
fs: {
// The engine package lives outside this project's root (a sibling directory reached
// through a node_modules symlink); allow Vite to serve/watch files from there too.
allow: [rootDir, engineDir],
},
},
});