Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing SASS entry point #1595

Merged
merged 3 commits into from
Aug 15, 2022
Merged

fix: add missing SASS entry point #1595

merged 3 commits into from
Aug 15, 2022

Conversation

santam85
Copy link
Contributor

@santam85 santam85 commented Aug 9, 2022

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.

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.
@adriatomas
Copy link

LGTM!

Copy link
Owner

@mattlewis92 mattlewis92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for the fix!!

@mattlewis92 mattlewis92 changed the title Adding SASS entry point fix: add missing SASS entry point Aug 15, 2022
@mattlewis92 mattlewis92 enabled auto-merge (squash) August 15, 2022 16:21
@mattlewis92 mattlewis92 disabled auto-merge August 15, 2022 16:21
@mattlewis92 mattlewis92 enabled auto-merge (squash) August 15, 2022 16:23
@mattlewis92 mattlewis92 merged commit c83293c into mattlewis92:main Aug 15, 2022
@mattlewis92
Copy link
Owner

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

@santam85
Copy link
Contributor Author

Yup thanks, works perfectly!

@h4k1m13or
Copy link

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
Copy link
Owner

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
Copy link

h4k1m13or commented May 24, 2024

it works, Thank you for the quick response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't import angular-calendar SASS files in an Angular project.
4 participants