mermaid/vite.config.ts

35 lines
998 B
TypeScript
Raw Normal View History

import jison from './.vite/jisonPlugin.js';
2023-03-11 15:27:16 +01:00
import typescript from '@rollup/plugin-typescript';
2022-09-22 12:05:22 +02:00
import { defineConfig } from 'vitest/config';
export default defineConfig({
resolve: {
2023-03-11 15:27:16 +01:00
extensions: ['.js'],
2022-09-22 12:05:22 +02:00
},
2023-03-11 15:27:16 +01:00
plugins: [
jison(),
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
typescript({ compilerOptions: { declaration: false } }),
],
2022-09-22 12:05:22 +02:00
test: {
environment: 'jsdom',
globals: true,
2022-09-25 20:18:16 +02:00
// TODO: should we move this to a mermaid-core package?
setupFiles: ['packages/mermaid/src/tests/setup.ts'],
2022-09-22 12:15:44 +02:00
coverage: {
2023-06-16 21:54:15 +02:00
provider: 'istanbul',
2022-09-22 12:15:44 +02:00
reporter: ['text', 'json', 'html', 'lcov'],
2023-06-16 20:24:02 +02:00
reportsDirectory: './coverage/vitest',
2023-06-17 13:22:03 +02:00
exclude: ['**/node_modules/**', '**/tests/**', '**/__mocks__/**'],
2022-09-22 12:15:44 +02:00
},
2022-09-22 12:05:22 +02:00
},
2022-10-05 13:14:05 +02:00
build: {
/** If you set esmExternals to true, this plugins assumes that
all external dependencies are ES modules */
commonjsOptions: {
esmExternals: true,
},
},
2022-09-22 12:05:22 +02:00
});