You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This could be a "when sass-embedded support is no longer experimental" modification
Modification Proposal
My understanding is that sass-embedded can be considered like-for-like to sass in terms of features and output i.e. assuming you can run sass-embedded, you can always use it instead of sass and get the exact same compiled output (just faster); and the main reason that sass is a thing is because sass-embedded has more complicated OS requirements being a compiled binary.
Thankfully package.json has a way of expressing dependencies which are desirable but OS restricted and so whose incompatibility with the current OS that is being installed on should not be considered a failure, allowing us to specify sass-embedded as a dependency alongside sass as a fallback i.e.
Now this is technically documented (though in the context of node-sass) and we can explicitly change this using implementation; however that would require us to have resolving logic in our webpack config across all applications and projects.
I figure sass was preferred back when it was just node-sass because the latter is technically deprecated and is not like-for-like, but maybe it's time to consider revising the default implementation order with the introduction of sass-embedded?
I think there are a few ways this could be done which would all be fine:
just change the default order to look for sass-embedded first
introduce a new implementation on the lines of prefer-sass-embedded (or a dedicated preferSassEmbedded boolean option)
support a comma list of implementations to try first to allow specifying order: sass-embedded,sass (though this is probably a bit much given there's not expected to be yet another sass implementation...)
Expected Behavior / Situation
sass-loader prefers sass-embedded by default, allowing us to manage providing the fastest sass implementation possible for the host, such as with optionalDependencies or installing sass-embedded in a dedicated step during building our docker images, provisioning servers, etc.
Actual Behavior / Situation
sass-loader loads sass by default, ignoring sass-embedded
Please paste the results of npx webpack-cli info here, and mention other relevant information
sass-embedded is still not very stable and a new API (which we need to use in future) is still under constuction, that is why we prefer sass right now
But I am fine with
support a comma list of implementations to try first to allow specifying order: sass-embedded,sass (though this is probably a bit much given there's not expected to be yet another sass implementation...)
Note
This could be a "when
sass-embedded
support is no longer experimental" modificationModification Proposal
My understanding is that
sass-embedded
can be considered like-for-like tosass
in terms of features and output i.e. assuming you can runsass-embedded
, you can always use it instead ofsass
and get the exact same compiled output (just faster); and the main reason thatsass
is a thing is becausesass-embedded
has more complicated OS requirements being a compiled binary.Thankfully
package.json
has a way of expressing dependencies which are desirable but OS restricted and so whose incompatibility with the current OS that is being installed on should not be considered a failure, allowing us to specifysass-embedded
as a dependency alongsidesass
as a fallback i.e.However it seems that
sass-loader
always favors loadingsass
, so in the above it'll never usesass-embedded
by default:sass-loader/src/utils.js
Lines 4 to 25 in bd65cba
Now this is technically documented (though in the context of
node-sass
) and we can explicitly change this usingimplementation
; however that would require us to have resolving logic in our webpack config across all applications and projects.I figure
sass
was preferred back when it was justnode-sass
because the latter is technically deprecated and is not like-for-like, but maybe it's time to consider revising the default implementation order with the introduction ofsass-embedded
?I think there are a few ways this could be done which would all be fine:
sass-embedded
firstimplementation
on the lines ofprefer-sass-embedded
(or a dedicatedpreferSassEmbedded
boolean option)sass-embedded,sass
(though this is probably a bit much given there's not expected to be yet another sass implementation...)Expected Behavior / Situation
sass-loader
preferssass-embedded
by default, allowing us to manage providing the fastest sass implementation possible for the host, such as withoptionalDependencies
or installingsass-embedded
in a dedicated step during building our docker images, provisioning servers, etc.Actual Behavior / Situation
sass-loader
loadssass
by default, ignoringsass-embedded
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: