Closed matthew-dean closed 1 year ago
@matthew-dean
I'm sorry to confuse you, but in some situations of daily development, we can't use local react
. For example, the application I'm currently developing is a sub-application, and I use external react
which is from a main application.
$linkdesign.React
means window.$linkdesign.React
that is external react
, so the vite-plugin-external
makes sense.
You'd think that the setup for vite-plugin-external was straightforward, but the documentation is completely opaque:
What is
React
supposed to represent? Is this a name that's used somewhere? Presumably,react
is the package, so it's not clear why it isn't:externals: ['react']
like a Rollup plugin would be. The documentation doesn't identify what these do or how this will affect the packaging.When it gets here:
Now this makes even less sense. What is
$linkdesign.React
?? What does this do? Is this assigning something? To what? And why?