-
Notifications
You must be signed in to change notification settings - Fork 33
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
Expose sass variables to import them from the package #95
Comments
Hey @Rusinas, @import 'node_modules/my-lib/sass/mixins'; // The '~' only works in tools that support it (Angular, etc.).
// ... Also if all you're publishing is sass files then you should be able to set your package.json's |
@Rusinas Hey, actually an even better idea might be to not worry about putting your sass files in the 'dist/' directory due them being directly importable, if the are deployed with your package:
somewhere_in_app_code.scss // If using a build tool that allows the `~` symbol:
@import "~{example-project}/mixins";
// If no `~` support
@import "node_modules/{example-project}/mixins"; A bit cleaner (IMO) |
@Rusinas Hey, Example: package.json: {
"exports": {
"./scss/*": {
"sass": "./src/scss/*",
"default": "./src/scss/*"
}
}
}
Also, note, this feature has been tested on client projects running both webpack 5, and/or Angular 13, and works as expected. If you need any further help please feel free to re-open the ticket. -- Closing ticket since solutions are available |
I'm not sure if this is the right place to ask this, but I am struggling with this for quite a long time now.
The idea is simple. I have npm package and it has some sass variables and mixins. And I need to provide them with the package, so in my projects I could just:
MyBeatifulProject/styles/main.sass
:So, in order to make this working I have to put my
mixins.sass
in thedist
somehow. And I don't have any ideas.I am aware that this plugin just compiles .sass files to .css and put them in the dist the way I want to, but maybe somebody here can point me to the right direction.
The text was updated successfully, but these errors were encountered: