mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-02-04 07:13:25 +08:00
Trim down vite config
This commit is contained in:
parent
0ee0862fae
commit
f27dff2186
@ -1,7 +1,7 @@
|
|||||||
import jison from 'jison';
|
import { Generator } from 'jison';
|
||||||
import { defineConfig } from 'vitest/config';
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
const fileRegex = /\.(jison)$/;
|
const fileRegex = /\.jison$/;
|
||||||
|
|
||||||
/** Transforms jison to js. */
|
/** Transforms jison to js. */
|
||||||
export function jisonPlugin() {
|
export function jisonPlugin() {
|
||||||
@ -10,9 +10,10 @@ export function jisonPlugin() {
|
|||||||
|
|
||||||
transform(src: string, id: string) {
|
transform(src: string, id: string) {
|
||||||
if (fileRegex.test(id)) {
|
if (fileRegex.test(id)) {
|
||||||
|
console.log('Transforming', id);
|
||||||
return {
|
return {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
code: new jison.Generator(src, { 'token-stack': true }).generate(),
|
code: new Generator(src, { 'token-stack': true }).generate(),
|
||||||
map: null, // provide source map if available
|
map: null, // provide source map if available
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -26,16 +27,8 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
plugins: [jisonPlugin()],
|
plugins: [jisonPlugin()],
|
||||||
test: {
|
test: {
|
||||||
// coverage: {
|
|
||||||
// enabled: true,
|
|
||||||
// },
|
|
||||||
environment: 'jsdom',
|
environment: 'jsdom',
|
||||||
globals: true,
|
globals: true,
|
||||||
mockReset: true,
|
|
||||||
clearMocks: true,
|
|
||||||
deps: {
|
|
||||||
inline: ['dagre-d3', 'd3'],
|
|
||||||
},
|
|
||||||
setupFiles: ['src/tests/setup.ts'],
|
setupFiles: ['src/tests/setup.ts'],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user