This package provides Connect/Express middleware for compiling SASS files on the fly. It is an extremely old package, with its last known release being version 0.0.3, published over a decade ago. Crucially, it relies on the `sass` Ruby gem for compilation, which is now considered deprecated and superseded by Dart Sass (the official `sass` npm package). Due to its age and dependency on an outdated, external compiler (Ruby Sass), `sass-middleware` is abandoned and incompatible with modern Node.js environments and contemporary Express/Connect applications. Developers should instead integrate modern build tools (e.g., Webpack, Vite, Gulp) with Dart Sass for static compilation, or explore direct usage of the `sass` npm package API for programmatic compilation within a build process. The `node-sass-middleware` package, while also deprecated due to its reliance on `node-sass` (LibSass), is a more recent alternative that still faced similar end-of-life issues. This package offers no current release cadence and no active development, making it unsuitable for any new or existing projects.
npm install sass-middlewareVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate `sass-middleware` into an Express application for on-the-fly SASS compilation, requiring the deprecated Ruby Sass gem.
Migrate to a modern SASS compilation workflow using Dart Sass (the `sass` npm package) as part of a build step (e.g., Webpack, Vite, Gulp) rather than on-the-fly middleware. Consider `node-sass-middleware` as a legacy alternative if `node-sass` is unavoidable, though `node-sass` itself is also deprecated.
Verify `gem install sass` has been successfully executed and the `sass` executable is in your system's PATH. However, the recommended fix is to avoid this package entirely due to its abandoned status.
Always check the package name and its dependencies carefully. For modern SASS compilation, use the official `sass` npm package (Dart Sass) directly in your build process.
Ensure the Ruby `sass` gem is installed by running `gem install sass` and that your system's PATH variable includes the directory where RubyGems installs executables.
Invoke the `sass-middleware` module with an options object, even if it's empty: `app.use(require('sass-middleware')({}));`