We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey! Thanks for this example. An improvement I found was setting the base property in the vite config to dynamically mount / unmount the css link.
base
const baseUrl = import.meta.env.BASE_URL; const mountCss = () => { try { const css = document.createElement('link'); css.id = 'single-spa-application:@norce/layout:css'; css.rel = 'stylesheet'; css.href = `${baseUrl}bundle.css`; document.head.appendChild(css); } catch (e) { console.error(e); } }; const unmountCss = () => { try { const css = document.getElementById( 'single-spa-application:@norce/layout:css' ); if (css) { document.head.removeChild(css); } } catch (e) { console.error(e); } }; export const bootstrap = svelteLifecycles.bootstrap; export const mount = (...props) => { mountCss(); return svelteLifecycles.mount(...props); }; export const unmount = (...props) => { unmountCss(); return svelteLifecycles.unmount(...props); };
The text was updated successfully, but these errors were encountered:
@ankarhem This is awesome, thanks for the improvement example
Sorry, something went wrong.
No branches or pull requests
Hey! Thanks for this example. An improvement I found was setting the
base
property in the vite config to dynamically mount / unmount the css link.The text was updated successfully, but these errors were encountered: