I'm using vue-cli 3 to create a lib for npm. All seems to be ok apart from that when a include the css into JavaScript, the lib does not work in server side rendering like Nuxt. It keeps saying document is not defined with fair reason.
So, my question is how to make it ready for SSR using embedded CSS?
I'm currently using
vue-cli-service build --target lib --name myLibName *.js
Also my vue config file
module.exports = {
css: {
extract: false,
},
configureWebpack: {
output: {
libraryTarget: 'umd',
},
},
};
I tried to use libraryExport: default as said in the vue-cli docs, but no luck.
Finally, yeah, if I extract CSS into a file everything works as expected with SSR.