CloudCannon / bookshop

📚 A component development workflow for static websites.
MIT License
243 stars 20 forks source link

support lang="scss" in external components #193

Open silveltman opened 1 month ago

silveltman commented 1 month ago

I import components from an external library. These components all use <style lang="scss">. I get these errors for all components:

Comments:

 > style:/usr/local/__site/src/node_modules/.pnpm/fulldev-ui@0.3.7_prettier-plugin-astro@0.13.0_prettier@3.2.5_vite@5.3.3_sass@1.77.6_/node_modules/fulldev-ui/src/components/_todo/Prose.astro:3:2: warning: Comments in CSS use "/* ... */" instead of "//"
    3 │   // @include component('prose') {
      ╵   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@imports:

 > style:/usr/local/__site/src/node_modules/.pnpm/fulldev-ui@0.3.7_prettier-plugin-astro@0.13.0_prettier@3.2.5_vite@5.3.3_sass@1.77.6_/node_modules/fulldev-ui/src/components/typography/ListItem.astro:1:8: error: Could not resolve "../../css/utils.scss" (the plugin "bookshop-astro" didn't set a resolve directory)
    1 │ @import '../../css/utils.scss';
      ╵         ~~~~~~~~~~~~~~~~~~~~~~

other:

  errors: [
    {
      detail: undefined,
      location: {
        column: 8,
        file: 'style:/usr/local/__site/src/node_modules/.pnpm/fulldev-ui@0.3.7_prettier-plugin-astro@0.13.0_prettier@3.2.5_vite@5.3.3_sass@1.77.6_/node_modules/fulldev-ui/src/components/_Component.astro',
        length: 19,
        line: 1,
        lineText: "@import '../css/utils.scss';",
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: `Could not resolve "../css/utils.scss" (the plugin "bookshop-astro" didn't set a resolve directory)`
    },

@ cloudcannon support: full logs on https://swift-tundra.cloudvent.net/

remi-freriks commented 1 month ago

We run into the same problem when we want to import scss variables into bookshop components.