Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ import sassPlugin from 'esbuild-plugin-sass'
✗ const sassPlugin = require('esbuild-plugin-sass')
Package is ESM-only as of v1.0.1; require() will fail unless using dynamic import or a bundler that can handle ESM.
Options
✓ import type { Options } from 'esbuild-plugin-sass'
✗ import { Options } from 'esbuild-plugin-sass' (no runtime value, only type)
Options is a TypeScript type, not a runtime export.
default with CommonJS
✓ const sassPlugin = require('esbuild-plugin-sass').default
✗ const sassPlugin = require('esbuild-plugin-sass')
In CJS, the default export is accessed via .default due to ESM compatibility.
Shows how to integrate Sass compilation into an esbuild build script using the plugin.
import esbuild from 'esbuild';
import sassPlugin from 'esbuild-plugin-sass';
await esbuild.build({
entryPoints: ['src/index.js'],
bundle: true,
outfile: 'bundle.js',
plugins: [sassPlugin()],
});
// src/index.js: import './style.scss';
Debug
Known issues
deprecatedPackage appears unmaintained since 2021; no updates for esbuild v0.12+ changes.fixConsider using esbuild-sass-plugin (still maintained) or write custom plugin.
affects: >=1.0.1
gotchaRequires esbuild >=0.11.14. Using an older version will fail.fixUpdate esbuild to >=0.11.14.
affects: esbuild <0.11.14
gotchaDoes not support esbuild's loader option for CSS; generates separate CSS file (does not inline into JS).fixUse esbuild's CSS handling if you need inlining. This plugin creates a .css file alongside the JS output.
affects: >=1.0.0
gotchaAssumes sass (dart-sass) is installed; does not work with node-sass by default.fixInstall dart-sass: npm install sass. For node-sass, you must alias 'sass' or modify resolution.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'esbuild-plugin-sass'
Package not installed or not resolved.
fixRun npm install esbuild-plugin-sass (and esbuild if not installed).
TypeError: sassPlugin is not a function
Using CJS require() on an ESM-only import; the imported value is an object, not the function directly.
fixUse dynamic import: const sassPlugin = (await import('esbuild-plugin-sass')).default; or switch to ES modules. Error: [plugin: sass] Option 'file' is not allowed
Passing 'file' in customSassOptions, which is reserved by plugin.
fixRemove the 'file' option from customSassOptions. The plugin sets it internally.
Audit
Dependencies
esbuildrequiredpeer dependency: required at runtime, version >=0.11.14