mirror of
https://github.com/penpot/penpot.git
synced 2026-09-13 14:19:23 -04:00
Replace __dirname with import.meta.dirname in the plugins workspace vite configs (root paths and the plugins-runtime tsconfigPath) and in frontend/vite.config.js, dropping the fileURLToPath fallback. Import vite.config.iife with the explicit .ts extension in the plugin-api-test-suite headless/tests configs and allow it in tsconfig.node.json (moduleResolution Bundler + noEmit), matching the mcp/packages/plugin precedent. Remove .storybook/vitest.setup.ts and its setupFiles entry; @storybook/addon-vitest 10.3+ provisions preview annotations automatically. These clear the Vite `configLoader: 'native'` warnings ahead of that loader becoming the default. AI-assisted-by: omen-alpha
39 lines
724 B
TypeScript
39 lines
724 B
TypeScript
/// <reference types="vitest/config" />
|
|
import { defineConfig } from 'vite';
|
|
export default defineConfig({
|
|
root: import.meta.dirname,
|
|
server: {
|
|
port: 4202,
|
|
host: '0.0.0.0',
|
|
},
|
|
|
|
preview: {
|
|
port: 4202,
|
|
host: '0.0.0.0',
|
|
},
|
|
|
|
resolve: {
|
|
tsconfigPaths: true,
|
|
},
|
|
|
|
build: {
|
|
outDir: '../../dist/apps/example-styles',
|
|
reportCompressedSize: true,
|
|
commonjsOptions: {
|
|
transformMixedEsModules: true,
|
|
},
|
|
},
|
|
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
|
|
reporters: ['default'],
|
|
coverage: {
|
|
reportsDirectory: '../../coverage/apps/example-styles',
|
|
provider: 'v8',
|
|
},
|
|
},
|
|
});
|