As part of Sass 1.71, a new concept of "package importer" has been introduced, allowing authors to write @use "pkg:bootstrap" instead of @use "~bootstrap" or @use "../../node_modules/bootstrap". Sass 1.71 includes a built-in package importer that supports Node modules.
Current behavior
CMD Clicking on a pkg: URL in a Sass file shows a "Unable to open 'pkg:..." modal, as the language service doesn't know how to resolve the files.
Expected behavior
CMD Clicking on a pkg: URL would take you to the corresponding file.
The resolution is almost identical to ~, resolving partials and index files. In addition, it also resolves conditional exports, and resolves in the following order:
sass, style, or default condition in package.json exports.
If there is not a subpath, then find the root export:
sass key at package.json root.
style key at package.json root.
index file at package root, resolved for file extensions and partials.
If there is a subpath, resolve that path relative to the package root, and resolve for file extensions and partials.
As part of Sass 1.71, a new concept of "package importer" has been introduced, allowing authors to write
@use "pkg:bootstrap"
instead of@use "~bootstrap"
or@use "../../node_modules/bootstrap"
. Sass 1.71 includes a built-in package importer that supports Node modules.Current behavior CMD Clicking on a
pkg:
URL in a Sass file shows a "Unable to open 'pkg:..." modal, as the language service doesn't know how to resolve the files.Expected behavior CMD Clicking on a
pkg:
URL would take you to the corresponding file.The resolution is almost identical to
~
, resolving partials and index files. In addition, it also resolves conditional exports, and resolves in the following order:Blog post Spec