vite-plugins icon indicating copy to clipboard operation
vite-plugins copied to clipboard

Only works when format is iife or umd?

Open IanVS opened this issue 3 years ago • 2 comments

I experimented with vite-plugin-externals, but it didn't seem to have any effect. Then I came across https://github.com/rollup/rollup/issues/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 avatar Nov 27 '22 23:11 IanVS

@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 https://github.com/rollup/rollup/issues/2374 because I never do output.globals and esm output format together.

fengxinming avatar Nov 28 '22 06:11 fengxinming

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. https://github.com/storybookjs/storybook/pull/19978 is the PR where I ended up using https://www.npmjs.com/package/rollup-plugin-external-globals instead.

IanVS avatar Nov 28 '22 19:11 IanVS