Registry / devops / sass-pack

sass-pack

JSON →
library2.2.2jsnpmunverified

A CLI tool and API for compiling SCSS/Sass to CSS with options for minification, sourcemaps, manifests, and external file packing. Version 2.2.2 is the latest stable release. This library wraps node-sass (LibSass, deprecated) and provides manifest generation, alias support, and folder-based output. Unlike other Sass compilers, it focuses on simple CLI usage and manifest-driven builds. Note: LibSass is deprecated; consider migrating to Dart Sass. Release cadence is low, with last release in 2020.

npm install sass-pack
INSTALL
IMPORT
SIG · SASS-PACK
S
sass-pack
devopsjavascriptv2.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const sassPack = require('sass-pack');
import sassPack from 'sass-pack'; // Not supported, CommonJS only
The package exports a single function. No ESM support; use require().
sassPack (function)
const sassPack = require('sass-pack'); sassPack({...}).then(...);
sassPack(); // Missing options object causes runtime error
Accepts an options object with properties like source, output, manifest, minify, etc. Returns a Promise.
CLI
sass-pack -o dist -s src --minify compressed
sass-pack --theme dark // Theme option removed in v2.0.0
CLI options changed in v2.0.0: 'theme' removed. Use API or CLI with updated flags.

Demonstrates using the sass-pack API with source globs, output, minification, sourcemaps, manifest generation, external files, alias, and error handling.

const sassPack = require('sass-pack'); const path = require('path'); sassPack({ source: [path.join(__dirname, 'src', '**', '*.scss')], output: path.join(__dirname, 'dist', 'css'), minify: 'compressed', sourcemaps: path.join(__dirname, 'dist', 'maps'), manifest: path.join(__dirname, 'dist', 'cssmanifest.json'), external: path.join(__dirname, 'external', '*.scss'), alias: '/absolute/path/to/replace', folders: false, hardquit: false }).then(() => { console.log('Sass compilation complete.'); }).catch(err => { console.error('Sass compilation failed:', err); });
Debug
Known issues
breakingv2.0.0 removed the 'theme' option. Scripts using --theme will break.
fix
Remove 'theme' from options; use 'source' and 'output' instead.
affects: >=2.0.0
deprecatedAs of v1.5.0, single-letter property names (e.g., 's' for source) are no longer supported in the API. Only full names (e.g., 'source') work.
fix
Use full property names like 'source' instead of 's'.
affects: >=1.5.0
deprecatedUnderlying node-sass (LibSass) is deprecated. New projects should use Dart Sass.
fix
Migrate to a Dart Sass-based compiler (e.g., sass package) and adjust API.
affects: all
gotchaThe package is CommonJS only and does not provide ESM exports. Using import will fail.
fix
Use require('sass-pack') instead of import.
affects: all
gotchaSource Maps generation (-x) requires the 'sourcemaps' option to be a path string. If omitted, no sourcemaps are generated.
fix
Provide a directory path for sourcemaps, e.g., sourcemaps: './maps'.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'node-sass'
Missing peer dependency node-sass; must be installed separately.
fix
npm install --save-dev node-sass (or globally if using CLI)
TypeError: source is not iterable
The 'source' option must be an array of strings when using API; single string is not allowed.
fix
Wrap the source path in an array: source: ['path/to/scss']
ENOENT: no such file or directory, open '...'
Specified manifest or output path does not exist; ensure directories are created.
fix
Create the output directory before running, or use a relative path that exists.
Upgrade
Version history
2.2.2latest on npm
Audit
Dependencies
node-sassrequiredCore Sass compilation (LibSass, deprecated).
clean-cssoptionalCSS minification when minify option is not 'nested'.
Agent activity
4 hits · last 30 days
node
4
Resources
sass-pack — npm install sass-pack · libregistry