Floffah / esbuild-plugin-d.ts

🔌 Convenience plugin for compiling typescript definitions with ESBuild
http://npm.im/esbuild-plugin-d.ts
MIT License
55 stars 5 forks source link

Use with ES6 #15

Closed Mqxx closed 1 week ago

Mqxx commented 1 week ago

Hey, how can I use this plugin using ES6 import syntax instead of common js require?

Floffah commented 1 week ago

The plugin is published with an esm bundle (dist/index.mjs) that your runtime should pick up automatically. You can import it either as a default import or using the exported function, e.g.

import dtsPlugin from "esbuild-plugin-d.ts";
// or
import { dtsPlugin } from "esbuild-plugin-d.ts";
Mqxx commented 1 week ago

Okay, thanks for the information! Maybe you could update the readme so that others can see this 👍