mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 04:44:08 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import jison from './.vite/jisonPlugin.js';
 | 
						|
import jsonSchemaPlugin from './.vite/jsonSchemaPlugin.js';
 | 
						|
import typescript from '@rollup/plugin-typescript';
 | 
						|
import { defaultExclude, defineConfig } from 'vitest/config';
 | 
						|
 | 
						|
export default defineConfig({
 | 
						|
  resolve: {
 | 
						|
    extensions: ['.js'],
 | 
						|
  },
 | 
						|
  plugins: [
 | 
						|
    jison(),
 | 
						|
    jsonSchemaPlugin(), // handles .schema.yaml JSON Schema files
 | 
						|
    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: [...defaultExclude, './tests/**', '**/__mocks__/**', '**/generated/'],
 | 
						|
    },
 | 
						|
    includeSource: ['packages/*/src/**/*.{js,ts}'],
 | 
						|
  },
 | 
						|
  build: {
 | 
						|
    /** If you set esmExternals to true, this plugins assumes that
 | 
						|
     all external dependencies are ES modules */
 | 
						|
 | 
						|
    commonjsOptions: {
 | 
						|
      esmExternals: true,
 | 
						|
    },
 | 
						|
  },
 | 
						|
  define: {
 | 
						|
    'import.meta.vitest': 'undefined',
 | 
						|
  },
 | 
						|
});
 |