vector-im-hydrogen-web/doc/IMPORT-ISSUES.md

12 lines
342 B
Markdown
Raw Permalink Normal View History

2022-08-01 13:30:56 +02:00
## How to import common-js dependency using ES6 syntax
---
Until [#6632](https://github.com/vitejs/vite/issues/6632) is fixed, such imports should be done as follows:
```ts
import * as pkg from "off-color";
// @ts-ignore
const offColor = pkg.offColor ?? pkg.default.offColor;
```
This way build, dev server and unit tests should all work.