-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add option to specify sass implementation to use. #274
Conversation
jgerigmeyer
commented
Feb 22, 2024
@@ -69,7 +69,7 @@ export type Parser = (rule: Rule, ctx: Context) => Parser; | |||
export const runSass = function ( | |||
trueOptions: TrueOptions, | |||
src: string, | |||
sassOptions?: Options<'sync'> | StringOptions<'sync'>, | |||
sassOptions?: any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unfortunate, but unavoidable if we really want to support any Sass implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tried it, but could you do something like Options<'sync'> | StringOptions<'sync'> | any
? Not sure if that just removes any benefit anyways, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these weren't TypeScript types, that would work. But the problem is until runtime we don't know whether sass
or sass-embedded
(or some other future implementation?) is available, so we don't have a place we can safely import the Options
and StringOptions
types from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirisuzanne @jamesnw Okay, I think this is ready for review now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test locally, but this makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some ideas, nothing blocking.
@@ -69,7 +69,7 @@ export type Parser = (rule: Rule, ctx: Context) => Parser; | |||
export const runSass = function ( | |||
trueOptions: TrueOptions, | |||
src: string, | |||
sassOptions?: Options<'sync'> | StringOptions<'sync'>, | |||
sassOptions?: any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tried it, but could you do something like Options<'sync'> | StringOptions<'sync'> | any
? Not sure if that just removes any benefit anyways, though.