Open mzkmzk opened 4 years ago
I have a vue component library (my-component) and another nuxt project (my-project), my-project uses my_component through npm,
my-component is packaged in the form of webpack target=web and published to npm
my-project needs to be compatible with both ssr and spa (non-ssr)
nuxt mode: universal packaging
universal
npm run build & npm run start will report an errordocument is undefined
npm run build & npm run start
document is undefined
My idea is whether to add a judgment before this
if (!hasDocument) { return noop }
https://github.com/vuejs/vue-style-loader/blob/477c25e1a506c54e18cb443f7981aed6d4e80e65/lib/addStylesClient.js#L119-L120
pull request: #45
Background:
I have a vue component library (my-component) and another nuxt project (my-project), my-project uses my_component through npm,
my-component is packaged in the form of webpack target=web and published to npm
Question:
my-project needs to be compatible with both ssr and spa (non-ssr)
nuxt mode:
universal
packagingnpm run build & npm run start
will report an errordocument is undefined
Solve:
My idea is whether to add a judgment before this
https://github.com/vuejs/vue-style-loader/blob/477c25e1a506c54e18cb443f7981aed6d4e80e65/lib/addStylesClient.js#L119-L120
pull request: #45