Unify preview-aware transforms across scene drawing, labels, selection and input. Give live property and creation edits explicit preview ownership, preserve cancellation and one-step undo, and reuse bounded text preparation resources. Include retained device-grid handling, worktree HMR coverage, and nested/reflected interaction regressions in this cohesive progress checkpoint. Validation: full check passes; 734 scoped unit tests and 53 targeted browser tests pass. This is NOT merge-ready: the unchanged exact nested filled-section held/released regression still fails with 63 differing pixels (maximum channel delta 5/255). The browser pass count excludes that separately run failure and the previously classified paint-field-width baseline. Raster-origin investigation and broader acceptance remain outstanding.
53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
import process from 'node:process'
|
|
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import IconsResolver from 'unplugin-icons/resolver'
|
|
import Icons from 'unplugin-icons/vite'
|
|
import Components from 'unplugin-vue-components/vite'
|
|
import { defineConfig } from 'vite'
|
|
|
|
import packageJson from './package.json'
|
|
import { createOpenPencilAliases } from './vite/aliases'
|
|
import {
|
|
localAutomationRoute,
|
|
localAutomationToken,
|
|
openPencilAutomationPlugin
|
|
} from './vite/automation'
|
|
import { copyCanvasKitAssetsPlugin } from './vite/canvaskit-assets'
|
|
import { openPencilPwaPlugin } from './vite/pwa'
|
|
import { rawMarkdownPlugin } from './vite/raw-markdown'
|
|
import { createDevServerOptions } from './vite/server'
|
|
|
|
const host = process.env.TAURI_DEV_HOST
|
|
const automationRoute = localAutomationRoute(host)
|
|
|
|
export default defineConfig(async ({ command }) => ({
|
|
resolve: {
|
|
alias: createOpenPencilAliases(__dirname)
|
|
},
|
|
define: {
|
|
__OPENPENCIL_APP_VERSION__: JSON.stringify(packageJson.version),
|
|
__OPENPENCIL_LOCAL_AUTOMATION_TOKEN__: JSON.stringify(localAutomationToken(command)),
|
|
__OPENPENCIL_LOCAL_AUTOMATION_URL__: JSON.stringify(automationRoute.browserURL),
|
|
__OPENPENCIL_LOCAL_AUTOMATION_HTTP_URL__: JSON.stringify(
|
|
automationRoute.browserURL.replace(/^ws/, 'http')
|
|
)
|
|
},
|
|
plugins: [
|
|
rawMarkdownPlugin(),
|
|
copyCanvasKitAssetsPlugin(),
|
|
tailwindcss(),
|
|
Icons({ compiler: 'vue3' }),
|
|
Components({ resolvers: [IconsResolver({ prefix: 'icon' })] }),
|
|
openPencilAutomationPlugin(command, host),
|
|
vue(),
|
|
openPencilPwaPlugin()
|
|
],
|
|
clearScreen: false,
|
|
build: {
|
|
chunkSizeWarningLimit: 2500
|
|
},
|
|
server: createDevServerOptions(host, __dirname)
|
|
}))
|