-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
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
Bundle CSS file if CSS is not injected to DOM #11
Conversation
Thank you so much for the PR! I think it should be fine to just do it the same as vue without having the internal css parsing? What do you think? (removing CSSAsset in here) |
I decided to use
So you want |
@akihikodaki I only proposed that if it would get rid of CSSAsset if it doesn't than it doesn't really matter. |
@DeMoorJasper Well, I'm having a bit difficulty to understand your comment. You mean |
Ow sorry, I meant if putting css in a seperate file gets rid of CSSAsset i would've preferred it, but apparently it doesn't so the default value doesn't really matter now. Basically meaning leave the PR as is, unless u can fix the CSSAsset hack fix :) |
I understand. in the current implementation,
.main {
/* Reference an image file */
background: url('./images/background.png');
color: red;
} (copied from https://parceljs.org) So I'm wondering if you think this CSS should be supported. |
Yes it should, kinda surprised svelte doesn't automatically transform css requires into js requires if it inlines it. I'll merge, possibly improve and release this soonish |
* Bundle CSS file if CSS is not injected to DOM (DeMoorJasper#11) * add test environment * 1.0.0
VueAsset
does this, so why doesn'tSvelteAsset
?Some design questions:
compilerOptions.css
befalse
by default? This would be a breaking change, of course. However, it would bring consistency withCSSAsset
andVueAsset
.CSSAsset
to post-transform CSS, but is it really fine? It already haspreprocess
to transform CSS, and this feature is kind of redundant. I decided to use the class, however, because it already employsJSAsset
to transform JavaScript output, and theCSSAsset
brings an important feature: to resolveurl(./foo.png)
.