I am using vue-cli to build a librabry (npm package) to work for both SSR and client side. All seems to be working a part from that the CSS loads only if the component is present in the page that is being refreshing. However, if access any other pages that there is not the component, and then navigate (vue-route) to the page that the component is present, the CSS is not being loaded.
Currently, I need to import the lib as well as the CSS which I think is not ideal like so
import Vue from 'vue';
import myLib from 'myLib';
import 'myLib/dist/myLib-ssr.css';
Vue.use(myLib);
Any thoughts to fix it?