/// import { defineConfig } from 'vite'; import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ root: __dirname, cacheDir: '../../node_modules/.vite/apps/example-plugin', server: { port: 4200, host: 'localhost', }, preview: { port: 4201, host: 'localhost', }, plugins: [nxViteTsPaths()], // Uncomment this if you are using workers. // worker: { // plugins: [ nxViteTsPaths() ], // }, build: { outDir: '../../dist/apps/example-plugin', reportCompressedSize: true, commonjsOptions: { transformMixedEsModules: true, }, rollupOptions: { input: { plugin: 'src/plugin.ts', index: './index.html', }, output: { entryFileNames: '[name].js', }, }, sourcemap: true, }, test: { globals: true, cache: { dir: '../../node_modules/.vitest', }, environment: 'jsdom', include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], reporters: ['default'], coverage: { reportsDirectory: '../../coverage/apps/example-plugin', provider: 'v8', }, }, });