mattlewis92 / angular-calendar

A flexible calendar component for angular 15.0+ that can display events on a month, week or day view.
https://mattlewis92.github.io/angular-calendar/
MIT License
2.72k stars 865 forks source link

fix: add missing SASS entry point #1595

Closed santam85 closed 2 years ago

santam85 commented 2 years ago

This change would allow importing the sass files in Angular projects in the following fashion: @import "~angular-calendar/scss/angular-calendar"; That is beneficial for plugins trying to find the critical path CSS, and allows to avoid having to hardcode a relative path to the node_module, simplifying adoption in monorepos with multiple projects.

Fixes #1596 and errors like:

SassError: Can't find stylesheet to import.
   ╷
12 │ @import "~angular-calendar/scss/angular-calendar";
   │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  src/styles.scss 12:9  root stylesheet

Alternatively, this can be extended to all scss files by adding instead:

    "./scss/*" : {
      "sass": "./scss/*"
    },

EDIT After some research and testing, I updated the PR to use the alternative approach shown above, looks like it's the one that has the best compatibility.

adriatomas commented 2 years ago

LGTM!

mattlewis92 commented 2 years ago

Released as 0.30.1, please let me know if that works for you! 🙌

santam85 commented 2 years ago

Yup thanks, works perfectly!

h4k1m13or commented 3 months ago

Hello @santam85 & @mattlewis92 i was using this in v0.28.28: @import '~angular-calendar/scss/angular-calendar.scss';, but it's not working in v0.31.1 any idea why ?

mattlewis92 commented 3 months ago

Hello @santam85 & @mattlewis92 i was using this in v0.28.28: @import '~angular-calendar/scss/angular-calendar.scss';, but it's not working in v0.31.1 any idea why ?

I think it's because angular dropped support for the leading ~, try @import 'angular-calendar/scss/angular-calendar.scss'; instead

h4k1m13or commented 3 months ago

it works, Thank you for the quick response