mirror of
https://github.com/mermaid-js/mermaid-live-editor.git
synced 2026-11-04 08:59:08 +00:00
Address review feedback: static/embed.js is now generated from src/embed-loader.ts via a small Vite lib-mode config (pnpm build:embed, chained into dev and build). The generated file is gitignored, and the source is covered by svelte-check and eslint.
19 lines
551 B
JavaScript
19 lines
551 B
JavaScript
import { defineConfig } from 'vite';
|
|
|
|
// Builds the standalone <mermaid-embed> loader (src/embed-loader.ts) into static/embed.js,
|
|
// which the SvelteKit build then ships verbatim as /embed.js. Run via `pnpm build:embed`
|
|
// (chained into `pnpm dev` and `pnpm build`); the output file is gitignored.
|
|
export default defineConfig({
|
|
build: {
|
|
emptyOutDir: false,
|
|
lib: {
|
|
entry: 'src/embed-loader.ts',
|
|
fileName: () => 'embed.js',
|
|
formats: ['iife'],
|
|
name: 'mermaidEmbed'
|
|
},
|
|
minify: false,
|
|
outDir: 'static'
|
|
}
|
|
});
|