Registry / devops / esbuild-plugin-scss

esbuild-plugin-scss

JSON →
library1.0.0jsnpmunverified

An esbuild plugin that compiles SCSS/SASS files to CSS during the build process. Version 1.0.0 uses the 'sass' package under the hood. It replaces an older plugin with a similar name that became unmaintained. No specific release cadence. Key differentiators: simple setup, works with esbuild's plugin system, and handles SCSS imports seamlessly. Ideal for projects already using esbuild and wanting to integrate SCSS compilation without additional loaders.

npm install esbuild-plugin-scss
INSTALL
IMPORT
SIG · ESBUILD-PLUGIN-SCS
E
esbuild-plugin-scss
devopsjavascriptv1.0.0
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.

esbuildSCSS
import esbuildSCSS from 'esbuild-plugin-scss'
const esbuildSCSS = require('esbuild-plugin-scss')
Use ESM import. CJS require also works but is not recommended for new projects.
esbuild
import esbuild from 'esbuild'
const esbuild = require('esbuild')
Ensure esbuild is installed. CJS require also works.
default plugin export
esbuild.build({ plugins: [esbuildSCSS] })
esbuild.build({ plugins: [esbuildSCSS()] })
The plugin is exported as a function that returns a plugin object; passing it directly works.

Shows basic usage: import the plugin and pass it to esbuild's plugins array. Assumes 'sass' is installed.

import esbuild from 'esbuild'; import esbuildSCSS from 'esbuild-plugin-scss'; await esbuild.build({ entryPoints: ['src/index.js'], bundle: true, outfile: 'dist/bundle.js', plugins: [esbuildSCSS], });
Debug
Known issues
deprecatedThe 'esbuild-sass-plugin' package is unmaintained; this package is a replacement.
fix
Use 'esbuild-plugin-scss' instead of 'esbuild-sass-plugin'.
affects: >=0.0.0
gotchaThe plugin expects 'sass' as a peer dependency; not installing it will cause a runtime error.
fix
Install 'sass' alongside 'esbuild-plugin-scss': npm install sass
affects: *
gotchaThe plugin does not support custom options for the 'sass' compiler (e.g., includePaths, outputStyle).
fix
If you need custom sass options, consider forking the plugin or using a different plugin like 'esbuild-sass'.
affects: 1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'sass'
The 'sass' package is not installed, but it is required by the plugin.
fix
Run: npm install sass
TypeError: esbuildSCSS is not a function
Incorrect usage: the plugin is a function that returns a plugin object, but user called it with parentheses.
fix
Use: plugins: [esbuildSCSS] instead of plugins: [esbuildSCSS()]
Error: Build failed with 1 error: error: No loader is configured for ".scss" files
The plugin was not included in the build configuration.
fix
Ensure the plugin is added to the plugins array: plugins: [esbuildSCSS]
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
sassrequiredThe sass package is a peer dependency and used internally to compile SCSS files.
Agent activity
2 hits · last 30 days
node
2
Resources
esbuild-plugin-scss — npm install esbuild-plugin-scss · libregistry