forked from mermaid-js/mermaid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
44 lines (42 loc) · 1.26 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import jison from './.vite/jisonPlugin.js';
import jsonSchemaPlugin from './.vite/jsonSchemaPlugin.js';
import typescript from '@rollup/plugin-typescript';
import { defaultExclude, defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
resolve: {
extensions: ['.js'],
alias: {
// Define your alias here
$root: path.resolve(__dirname, 'packages/mermaid/src'),
},
},
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',
},
});