explodingcamera / esm

Monorepo with most of my JavaScript/Typscript Packages
MIT License
7 stars 0 forks source link

Incorrect Export in Documentation #2

Closed timbomckay closed 1 year ago

timbomckay commented 1 year ago

Hello, first off thanks for providing this plugin. I searched most of yesterday for a plugin that uses the new html-minified-terser to resolve a ReDoS vulnerability.

When I installed and imported the package it told me this wasn't exported:

https://github.com/explodingcamera/esm/blob/b0138b928030c55c0f2e7aca0526fe733bc725cc/packages/rollup-plugin-minify-template-literals/README.md?plain=1#L28

It looks like you're actually exporting it as default or as minifyHTMLLiterals

https://github.com/explodingcamera/esm/blob/b0138b928030c55c0f2e7aca0526fe733bc725cc/packages/rollup-plugin-minify-template-literals/lib/index.ts#L73-L74

So I imagine a consumer can either

import minifyTemplateLiterals from "rollup-plugin-minify-template-literals"; 

or

import { minifyHTMLLiterals } from "rollup-plugin-minify-template-literals"; 

Hope you can get this corrected soon as I'm posting this plugin in a few spots haha.

Thanks again

vdegenne commented 1 year ago

Yeah the exports are a mess on this package. I think you can simplify similar to @rollup/plugin-node-resolve:

export function nodeResolve(options?: RollupNodeResolveOptions): Plugin;
export default nodeResolve;

Thanks for the plugin!

explodingcamera commented 1 year ago

The exports should be fixed in rollup-plugin-minify-template-literals@1.1.0, thanks for the info!