shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.43k stars 186 forks source link

index.ts should use esm syntax and compile to cjs if necessary #273

Closed Astra-RX closed 2 years ago

Astra-RX commented 2 years ago

Expected Behavior / Situation

Plugin can be used with both import { WebpackManifestPlugin } from "webpack-manifest-plugin"; and const { WebpackManifestPlugin } = require("webpack-manifest-plugin");

Actual Behavior / Situation

WebpackManifestPlugin is not exported when using import, not shown in index.d.ts of course.

Modification Proposal

Use esm syntax named export in source code, then compile to cjs if necessary

shellscape commented 2 years ago

Sure, open a PR. Pretty simple change.

shellscape commented 2 years ago

Some other types needed improvement, so this was handled in 098b6ddbea8640f008cf5d786f7ae9d12cc54bb8