【问题标题】:How do I load pico css from node_modules in a svelte-kit app?如何在 svelte-kit 应用程序中从 node_modules 加载 pico css?
【发布时间】:2022-02-01 14:19:39
【问题描述】:

使用$ npm install @picocss/pico -D安装

在 rollup.config.js 中:

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


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

在 ./routes/__layout.svelte 我有:

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

</script>

只是在 UI 中出现错误,并且没有 css /bundle.css 存在。

【问题讨论】:

    标签: svelte sveltekit picocss


    【解决方案1】:

    我今天只是在使用它。我试过这个:

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

    我没有收到任何错误,但没有尝试任何其他操作。

    在我的例子中,我从原始 HTML 的 CDN 导入,它运行良好。

    【讨论】:

      猜你喜欢
      • 2019-02-07
      • 2017-02-25
      • 2018-02-05
      • 2021-11-23
      • 2019-10-22
      • 2012-01-15
      • 1970-01-01
      • 2021-11-20
      • 2021-12-21
      相关资源
      最近更新 更多