Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Offer rollup-plugin-terser as ES6 module #76

Closed
dilyanpalauzov opened this issue May 24, 2020 · 1 comment
Closed

Offer rollup-plugin-terser as ES6 module #76

dilyanpalauzov opened this issue May 24, 2020 · 1 comment

Comments

@dilyanpalauzov
Copy link

dilyanpalauzov commented May 24, 2020

I want to create an "index.html" file with rollup, which contains a script type=module and script nomodule tags. Per rollup/rollup#3536 rollup cannot call rollup/plugin-html once the ES6 and ES5 outputs are ready. So I am trying to switch to rollup API : rollup.rollup().write(). In package.json I have "type":"module" and in the file with rollup.rollup(…).write(…) I insert import {terser} from 'rollup-plugin-terser' as I had it in the rollup.config.js` file.

Node 14 says rollup-plugin-terser is expected to be in CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default exports.

  • Add module to package.json and allow the plugin to be loaded as ES6 module.
@TrySound
Copy link
Owner

Please check v6.1.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants