-
Notifications
You must be signed in to change notification settings - Fork 83
Error: Can't find stylesheet to import; @import 'material-theme'; #102
Comments
Did you install: sass, postcss and svelte-preprocess? |
Hi, exact same issue for me too. Clean new project, insalled sass, postcss, svelte-preprocess, added theme top level directory with _material-theme.scss The build fails like this: (plugin svelte) Error: Can't find stylesheet to import. |
https://svelte-materialify.vercel.app/getting-started/installation/#advanced-install
preprocess: sveltePreprocess({
scss: {
includePaths: ['theme'],
},
}), |
Thanks. It's working now. I think the issue for both me and OP was referencing the svelte.config.js from the rollup.config.js // our brains read this as being a regular import, not referencing one config file from another I replicated the change manually in rollup.config.js and this works as shown below. plugins: [ Thank you for your work on this! |
Adding to the |
@TheComputerM Could you add this information to your getting started instructions? |
Will do, but also have to mention to add it to the svelte.config.js. |
This is still not working for me with webpack. I could ignore it for a while as I was making development and include the regular package. But seeing how svelte-materialify is taking >2MB of my root bundle, I cannot ignore it anymore as I am approaching release. |
@FunMiles Can you provide me the config files for webpack and svelte (also you need not worry about the root package as most likely all the files will be bundled to js reducing the final bundle size) |
Correction. After one more try, I got it to work (I saw what I think are changes from what I had read before in the README and noticed the improved doc for webpack`. import { ButtonGroup, ButtonGroupItem, Dialog, Button } from 'svelte-materialify'; with import { ButtonGroup, ButtonGroupItem, Dialog, Button } from 'svelte-materialify/src'; I was hoping that going from the compiled code to the source would have shake code to a smaller size. I guess I will have to keep investigating further. PS: Full apologies. As noted above, the issue was resolved after reading what I think is newer doc. As for the bundle size, it was mostly an unrelated issue of a strange unused import that messed with typescript, leaving >2.5MB of unused code. |
@FunMiles I followed the instructions on this topic, but Rollup still adds redundant CSS. For this #231 (comment), I did some tests with import MaterialAppMin from 'svelte-materialify/src/components/MaterialApp/MaterialAppMin.svelte';
import AppBar from 'svelte-materialify/src/components/AppBar'; |
I am trying to use this component system with the current version of the Svelte template:
https://github.com/sveltejs/template
However I am getting an error:
I compared with your older template from here
https://github.com/TheComputerM/svelte-materialify-template
and the difference seems to be mainly this import in the rollup:
import css from 'rollup-plugin-css-only';
and a file called theme/_material-theme.scss
I could not get it to run though.
Any ideas?
The text was updated successfully, but these errors were encountered: