fengxinming/vite-plugins

Only works when format is iife or umd?

IanVS opened this issue · 2 comments

IanVS commented

I experimented with vite-plugin-externals, but it didn't seem to have any effect. Then I came across rollup/rollup#2374, which notes that external and output.globals only work with iife or umd output formats. Maybe there should be a disclaimer in the readme to explain that?

@IanVS vite-plugin-external or vite-plugin-externals? Would you mind if I got an example from you about this issue, actually I do not know this issue rollup/rollup#2374 because I never do output.globals and esm output format together.

IanVS commented

Sorry, vite-plugin-external. I was trying to use this plugin along with vite in middleware mode to replace references to internal storybook packages with references from the global scope. storybookjs/storybook#19978 is the PR where I ended up using https://www.npmjs.com/package/rollup-plugin-external-globals instead.