node-sass-tilde-importer is a custom importer for node-sass that enabled the resolution of Sass `@import` statements beginning with a tilde (~) to absolute paths within the nearest `node_modules` directory. This functionality was essential for integrating npm-installed Sass libraries (e.g., Bootstrap's SCSS files) into projects built with `node-sass` and bundlers like Webpack (via `sass-loader`). The package's current stable version is 1.0.2, last published in March 2018. It has no discernible release cadence, indicating it is no longer actively maintained. Its primary differentiator was providing `~` path resolution for `node-sass`, a feature now largely superseded or natively handled by modern Sass compilers (Dart Sass, available as the `sass` npm package) and contemporary bundler loaders (e.g., `sass-loader` v8+). Given the end-of-life status and deprecation of `node-sass` itself, this package is considered obsolete for new projects and for migrations to modern Sass environments.
npm install node-sass-tilde-importerVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use node-sass-tilde-importer with the deprecated `node-sass` compiler to resolve tilde imports.
Migrate your Sass compilation pipeline from `node-sass` to `sass` (Dart Sass). This package will become obsolete in a Dart Sass environment.
Remove `node-sass-tilde-importer`. Configure `sass-loader` to use `implementation: require('sass')` and rely on its built-in Webpack resolution for `~` imports, or explicitly set `sassOptions.includePaths` to include `node_modules`.Avoid using this package in new projects. For existing projects, prioritize migrating to Dart Sass and removing this dependency.
As part of migrating to Dart Sass, update your Sass stylesheets to use the `@use` and `@forward` syntax instead of `@import`.
Uninstall `node-sass` and replace it with `sass` (Dart Sass). If using a build tool like Webpack, ensure `sass-loader` is configured to use `sass` as its `implementation`.
If using `sass-loader` with Dart Sass, remove `node-sass-tilde-importer`. `sass-loader` should handle `~` prefixes to `node_modules` automatically. If issues persist, configure `sassOptions.includePaths` in your `sass-loader` options to explicitly include `node_modules`.