Open dephiros opened 4 years ago
@dephiros Did you configure the preprocessor in your svelte.config.js
? I think that is required.
@nickreese , yeah I did and the import does work for me.(the style does apply to the page The problem for me is the style ended up in the html header instead of a separate file which is better for caching
@dephiros I completely misread your first comment. Yep, that is how it is configured. CSS from within Svelte components are written to the head of the page. This could be something we can rework in the future if someone wanted to spearhead it.
@nickreese , I am not very familiar with rollup. Would you be able to provide a general direction in how to change this behavior?
@dephiros Currently there are 2 rollup configs generated during dev
mode and 2 during production
. They differ quiet a bit.
--- edit:
But, the nice thing is that they are encapsulated in the createSSRConfig
function in the rollup.config.js.
You should be able to adapt this pretty easily for production, but the bundling during development is quiet different.
--- /edit
I'd find a template where someone was doing what you're looking to do with the generic svelte rollup then:
I'd agree that this should be configurable, but it hasn't made it on our priority list for ElderGuide.com so I haven't built it yet.
I am trying to port one of my sapper app over and run into a bit of a problem with external sass file
In my sapper project, I add
to the layout component. I tried to do the same thing in this template and it works. However, the style is inline inside the html instead of extracted to a separate file like sapper.
Is there a way to achieve the same behavior with this template.
Thank you