This commit is contained in:
Sidharth Vinod
2022-09-01 23:38:13 +05:30
parent 01562528b7
commit 904eccc4fa
5 changed files with 136 additions and 6 deletions

26
vite.config.js Normal file
View File

@@ -0,0 +1,26 @@
import { resolve } from 'path';
import { defineConfig } from 'vite';
import jison from './jison';
export default defineConfig({
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: {
plugins: [jison()],
// make sure to externalize deps that shouldn't be bundled
// into your library
output: {
name: 'mermaid',
// Provide global variables to use in the UMD build
// for externalized deps
},
},
},
});