Skip to content

Can sass-loader understand package.json "exports" field? #17990

Answered by alexander-akait
krutoo asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for delay, there is an intresting problem... exports works fine, you have:

// @use "my-library/utils.scss"; // also not working

But it works fine, just uncomment it and check out.

Because import * as mod from "something.js" requires an extension, you need to write scss extension too for sass, i.e. @use "my-library/utils.scss";, theoretically you can make a small plugin that allow to use it without the scss extensions, but I don't feel it is a right solution, import ... from "something.js" and the exports field were originally designed to have an extension at the end and I have strong feel if sass wants to be align with javascript and don't create potential misunderstanding for devel…

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@alexander-akait
Comment options

@krutoo
Comment options

@krutoo
Comment options

@alexander-akait
Comment options

Answer selected by krutoo
@nex3
Comment options

@krutoo
Comment options

@alexander-akait
Comment options

@nex3
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants