underfin / vite-plugin-vue2

Vue2 plugin for Vite
620 stars 83 forks source link

feature request: move normalizeComponent to package and allow it to be externalized #192

Open Aaron-Pool opened 2 years ago

Aaron-Pool commented 2 years ago

Context: I'm working with a large monorepo that has several packages with just a small handful of components in each package. The majority of these components are pulled in by the full app which is the true end-product.

Now, on to the feature request: I've recently noticed that, since the normalizeComponent function is inlined into each generated package bundle, I end up with this function, which is about 20% of the code of each bundled SFC, in every package output. I think eventually, this will lead to a non-negligible bump in the size of the package. Is there anyway we could get that function moved to it's own package so that it could be externalized and added as a dependency to the root app.