feat: boot-экран, стабильность Windows и оптимизация Pixi/пульта
- Экран загрузки (boot.html, bootWindow): статусы, ensureRoots и проверка лицензии, редактор после готовности; закрытие через destroy при closable:false. - Упакованное приложение на Windows: disableHardwareAcceleration, sandbox выкл. вне dev, отложенный показ редактора, ensureWindowBecomesVisible, фокус на splash при second-instance. - Vite: вход boot.html; eslint: игнор release/; тесты boot и maxFPS тикера. - Пульт: позиция курсора кисти через ref/DOM без setState на каждый move; черновик эффекта через rAF; Pixi: maxFPS 32, resolution cap, antialias off, debounce ResizeObserver, меньше частиц poisonCloud, contain на хосте. Made-with: Cursor
This commit is contained in:
+18
-1
@@ -2,7 +2,22 @@ import path from 'node:path';
|
||||
|
||||
import strip from '@rollup/plugin-strip';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { defineConfig } from 'vite';
|
||||
import { defineConfig, type Plugin } from 'vite';
|
||||
|
||||
/**
|
||||
* Vite в проде вешает `crossorigin` на script/link; при открытии HTML через `file://` в Electron
|
||||
* на Windows это часто приводит к тихому отказу загрузки ES-модулей (чёрный экран). macOS может «проглатывать».
|
||||
*/
|
||||
function stripCrossoriginForElectronFile(): Plugin {
|
||||
return {
|
||||
name: 'strip-crossorigin-electron-file',
|
||||
enforce: 'post',
|
||||
apply: 'build',
|
||||
transformIndexHtml(html) {
|
||||
return html.replace(/\s+crossorigin(?:=["']?[^"'>\s]+["']?)?/gi, '');
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const isProd = mode === 'production';
|
||||
@@ -17,6 +32,7 @@ export default defineConfig(({ mode }) => {
|
||||
plugins: [['babel-plugin-react-compiler', { target: '19' }]],
|
||||
},
|
||||
} as Parameters<typeof react>[0]),
|
||||
...(isProd ? [stripCrossoriginForElectronFile()] : []),
|
||||
],
|
||||
build: {
|
||||
outDir: path.resolve(__dirname, 'dist/renderer'),
|
||||
@@ -33,6 +49,7 @@ export default defineConfig(({ mode }) => {
|
||||
]
|
||||
: [],
|
||||
input: {
|
||||
boot: path.resolve(__dirname, 'app/renderer/boot.html'),
|
||||
editor: path.resolve(__dirname, 'app/renderer/editor.html'),
|
||||
presentation: path.resolve(__dirname, 'app/renderer/presentation.html'),
|
||||
control: path.resolve(__dirname, 'app/renderer/control.html'),
|
||||
|
||||
Reference in New Issue
Block a user