Closed zouhangwithsweet closed 1 year ago
Maybe this issue doesn't need to be fixed. I just use umd.
I don’t think this has anything to do with this plugin, but how Vite handles final file optimization. The line that is mentioned is used to properly resolve location of module to use and needs to be used here.
You are correct in that UMD output produces what you required. What I also found that works is you you export any type of content, e.g.
// …
// init stream
export default (() => {
setupPageStream();
})();
This will properly produce IIFE output with ringsOutput
library name.
Reproduction
https://stackblitz.com/edit/vitejs-vite-qiftgb?file=main.js
reference: https://github.com/vitejs/vite/issues/12872 And they found that if this line is commented https://github.com/niksy/node-stdlib-browser/blob/master/index.js#L10, the dist's syntax will be correct.
I hava not idea about that