mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
35 lines
992 B
TypeScript
35 lines
992 B
TypeScript
import jison from './.vite/jisonPlugin.js';
|
|
import typescript from '@rollup/plugin-typescript';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
extensions: ['.js'],
|
|
},
|
|
plugins: [
|
|
jison(),
|
|
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
|
|
typescript({ compilerOptions: { declaration: false } }),
|
|
],
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
// TODO: should we move this to a mermaid-core package?
|
|
setupFiles: ['packages/mermaid/src/tests/setup.ts'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html', 'lcov'],
|
|
reportsDirectory: './coverage/vitest',
|
|
exclude: ['**/node_modules/**', '**/tests/**', '**/__mocks__/**'],
|
|
},
|
|
},
|
|
build: {
|
|
/** If you set esmExternals to true, this plugins assumes that
|
|
all external dependencies are ES modules */
|
|
|
|
commonjsOptions: {
|
|
esmExternals: true,
|
|
},
|
|
},
|
|
});
|