Files
penpot/plugins/apps/plugin-api-test-suite/vite.config.ts
Alonso Torres cb21f6401a Add waitForLayoutUpdate plugin method (#9898)
*  Add waitForLayoutUpdate plugin method

*  Refactor internal wait for tasks
2026-07-28 14:44:30 +02:00

44 lines
1.1 KiB
TypeScript

/// <reference types="vitest/config" />
import { defineConfig } from 'vite';
export default defineConfig({
root: __dirname,
// Emit relative asset URLs in index.html so the built plugin works when served
// from a subdirectory (Penpot serves the bundled plugins under `/plugins/...`).
// Vite resolves `./` to `/` for the dev server, so `pnpm run dev` is unaffected.
base: './',
server: {
port: 4202,
host: '0.0.0.0',
cors: true,
},
preview: {
port: 4202,
host: '0.0.0.0',
cors: true,
},
resolve: {
tsconfigPaths: true,
},
build: {
outDir: '../../dist/apps/plugin-api-test-suite',
// Keep false so `watch` rebuilds don't wipe the sibling tests-bundle.js /
// headless.js outputs. The `build` script passes --emptyOutDir for a clean
// one-shot build.
emptyOutDir: false,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
},
rollupOptions: {
input: {
plugin: 'src/plugin.ts',
index: './index.html',
},
output: {
entryFileNames: '[name].js',
},
},
},
});