mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
b7d31adda4
The `node16` module resolution requires imports to use the `.js` file extension in type definitions. `@rollup/plugin-typescript` is needed to make this work with the Vite setup used by Mermaid. The module option for Mermaid internally is set to `nodenext`. This is needed to support `.json` imports. Note that setting `module` to `node16` or `nodenext` implies a matching `moduleResolution` value.
27 lines
624 B
TypeScript
27 lines
624 B
TypeScript
import jison from './.vite/jisonPlugin.js';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
extensions: [],
|
|
},
|
|
plugins: [jison()],
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
// TODO: should we move this to a mermaid-core package?
|
|
setupFiles: ['packages/mermaid/src/tests/setup.ts'],
|
|
coverage: {
|
|
reporter: ['text', 'json', 'html', 'lcov'],
|
|
},
|
|
},
|
|
build: {
|
|
/** If you set esmExternals to true, this plugins assumes that
|
|
all external dependencies are ES modules */
|
|
|
|
commonjsOptions: {
|
|
esmExternals: true,
|
|
},
|
|
},
|
|
});
|