How do I load pico css from node_modules in a svelte-kit app?

Viewed 668

Installed with $ npm install @picocss/pico -D

in rollup.config.js:

import css from "rollup-plugin-css-only";


...
    plugins: [
        css({ output: "static/bundle.css" }),
    ],

In ./routes/__layout.svelte I have:

<script>
    import "../../node_modules/@picocss/pico/css/pico.min.css";

</script>

Just get error in UI, and no css /bundle.css exists.

1 Answers

I was just working with it today. I tried this:

<script>
  import "@picocss/pico/css/pico.min.css";
</script>

I didn't get any errors with it, but didn't try anything beyond that.

In my case, I import from the CDN in the original HTML and it worked fine.

Related