explodingcamera/esm

Incorrect Export in Documentation

Closed this issue · 2 comments

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:

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

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

export default RollupPluginMinifyHTMLLiterals;
export const minifyHTMLLiterals = RollupPluginMinifyHTMLLiterals;

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

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!

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