mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
44 lines
1017 B
TypeScript
44 lines
1017 B
TypeScript
import jison from './.esbuild/jison';
|
|
import { resolve } from 'path';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
build: {
|
|
lib: {
|
|
entry: resolve(__dirname, 'src/mermaid.ts'),
|
|
name: 'mermaid',
|
|
// the proper extensions will be added
|
|
fileName: 'mermaid',
|
|
},
|
|
minify: 'esbuild',
|
|
rollupOptions: {
|
|
// make sure to externalize deps that shouldn't be bundled
|
|
// into your library
|
|
external: ['require', 'fs', 'path'],
|
|
output: [
|
|
{
|
|
name: 'mermaid',
|
|
format: 'esm',
|
|
sourcemap: true,
|
|
entryFileNames: 'mermaid.esm.js',
|
|
},
|
|
{
|
|
name: 'mermaid',
|
|
format: 'umd',
|
|
sourcemap: true,
|
|
entryFileNames: 'mermaid.js',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
resolve: {
|
|
extensions: ['.jison', '.js', '.ts', '.json'],
|
|
},
|
|
plugins: [jison()],
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: ['src/tests/setup.ts'],
|
|
},
|
|
});
|