mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
38 lines
941 B
JavaScript
38 lines
941 B
JavaScript
import { resolve } from 'path';
|
|
import { defineConfig } from 'vite';
|
|
import jison from './.esbuild/jison';
|
|
export default defineConfig({
|
|
plugins: [jison()],
|
|
resolve: {
|
|
extensions: ['.ts', '.js', '.json', '.jison'],
|
|
},
|
|
build: {
|
|
lib: {
|
|
entry: resolve(__dirname, 'src/mermaid.ts'),
|
|
name: 'mermaid',
|
|
// the proper extensions will be added
|
|
fileName: 'mermaid',
|
|
},
|
|
rollupOptions: {
|
|
// make sure to externalize deps that shouldn't be bundled
|
|
// into your library
|
|
external: ['require', 'fs', 'path'],
|
|
output: [
|
|
{
|
|
name: 'mermaid',
|
|
format: 'esm',
|
|
// Provide global variables to use in the UMD build
|
|
// for externalized deps
|
|
},
|
|
{
|
|
name: 'mermaid',
|
|
format: 'umd',
|
|
|
|
// Provide global variables to use in the UMD build
|
|
// for externalized deps
|
|
},
|
|
],
|
|
},
|
|
},
|
|
});
|