Support node16 module resolution

The `node16` module resolution requires imports to use the `.js` file
extension in type definitions.

`@rollup/plugin-typescript` is needed to make this work with the Vite
setup used by Mermaid.

The module option for Mermaid internally is set to `nodenext`. This is
needed to support `.json` imports. Note that setting `module` to
`node16` or `nodenext` implies a matching `moduleResolution` value.
This commit is contained in:
Remco Haszing
2023-03-11 14:54:21 +01:00
parent 273a9e7ad6
commit b7d31adda4
207 changed files with 707 additions and 662 deletions

View File

@@ -1,6 +1,6 @@
// @ts-expect-error Jison doesn't export types
import { parser } from './parser/classDiagram';
import classDb from './classDb';
import { parser } from './parser/classDiagram.js';
import classDb from './classDb.js';
import { vi, describe, it, expect } from 'vitest';
const spyOn = vi.spyOn;