Comments (3)
Yes, you can use single-spa-css to load css files that are in separate files. I'd like to switch over create-single-spa and vue-cli-plugin-single-spa over to use it rather than style-loader in production, but haven't done so yet. You can still do so though for your projects by modifying the webpack config to use https://webpack.js.org/plugins/mini-css-extract-plugin/ rather than style-loader.
from styleguide.
single-spa-css
is meant to use for single-spa app or parcel. But styleguide is of type utility and it doesn't make any sense to expose lifecycle methods(bootstrap, mount, unmount).
After some investigation, I've comed up with two solutions:
- Export cssLifecycles from styleguide utility, then import and integrate them to one of exist application lifecycles which always actived.
- Export cssLifecycles from styleguide utility, then register styleguide utility itself as application with
activeWhen
set to/
These two solutions work for me, I've chosed solution 1 after all, since it is weird to use utility as application. I've wonder if there any official recommend usage to combine single-spa-css
with utility?
from styleguide.
One option for utility modules is to use css browser modules, which are supported by systemjs. The css file would be a runtime static dependency of the systemjs bundle (a webpack external) and then the utility module can add it to the adopted stylesheets. I don't usually broadcast it as a solution because it requires some additional polyfilling for IE11 and the spec for CSS modules wasn't as far along in the standardization process as it is now. But that way would work well
from styleguide.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from styleguide.