{"id":21264,"library":"esbuild-plugin-sass","title":"esbuild-plugin-sass","description":"esbuild plugin for compiling Sass/SCSS files. v1.0.1 (no further updates since 2021). Integrates the node-sass or dart-sass compiler into esbuild's build pipeline. Supports custom Sass options (except file). Differentiates from alternatives like esbuild-sass-plugin by its minimal API and lack of active maintenance. Only peer dependency is esbuild >=0.11.14. Ships TypeScript types.","status":"maintenance","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/koluch/esbuild-plugin-sass","tags":["javascript","esbuild","plugin","sass","typescript"],"install":[{"cmd":"npm install esbuild-plugin-sass","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-sass","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-sass","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required at runtime, version >=0.11.14","package":"esbuild","optional":false}],"imports":[{"note":"Package is ESM-only as of v1.0.1; require() will fail unless using dynamic import or a bundler that can handle ESM.","wrong":"const sassPlugin = require('esbuild-plugin-sass')","symbol":"default","correct":"import sassPlugin from 'esbuild-plugin-sass'"},{"note":"Options is a TypeScript type, not a runtime export.","wrong":"import { Options } from 'esbuild-plugin-sass' (no runtime value, only type)","symbol":"Options","correct":"import type { Options } from 'esbuild-plugin-sass'"},{"note":"In CJS, the default export is accessed via .default due to ESM compatibility.","wrong":"const sassPlugin = require('esbuild-plugin-sass')","symbol":"default with CommonJS","correct":"const sassPlugin = require('esbuild-plugin-sass').default"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport sassPlugin from 'esbuild-plugin-sass';\n\nawait esbuild.build({\n  entryPoints: ['src/index.js'],\n  bundle: true,\n  outfile: 'bundle.js',\n  plugins: [sassPlugin()],\n});\n\n// src/index.js: import './style.scss';","lang":"typescript","description":"Shows how to integrate Sass compilation into an esbuild build script using the plugin."},"warnings":[{"fix":"Consider using esbuild-sass-plugin (still maintained) or write custom plugin.","message":"Package appears unmaintained since 2021; no updates for esbuild v0.12+ changes.","severity":"deprecated","affected_versions":">=1.0.1"},{"fix":"Update esbuild to >=0.11.14.","message":"Requires esbuild >=0.11.14. Using an older version will fail.","severity":"gotcha","affected_versions":"esbuild <0.11.14"},{"fix":"Use esbuild's CSS handling if you need inlining. This plugin creates a .css file alongside the JS output.","message":"Does not support esbuild's loader option for CSS; generates separate CSS file (does not inline into JS).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install dart-sass: npm install sass. For node-sass, you must alias 'sass' or modify resolution.","message":"Assumes sass (dart-sass) is installed; does not work with node-sass by default.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run npm install esbuild-plugin-sass (and esbuild if not installed).","cause":"Package not installed or not resolved.","error":"Error: Cannot find module 'esbuild-plugin-sass'"},{"fix":"Use dynamic import: const sassPlugin = (await import('esbuild-plugin-sass')).default; or switch to ES modules.","cause":"Using CJS require() on an ESM-only import; the imported value is an object, not the function directly.","error":"TypeError: sassPlugin is not a function"},{"fix":"Remove the 'file' option from customSassOptions. The plugin sets it internally.","cause":"Passing 'file' in customSassOptions, which is reserved by plugin.","error":"Error: [plugin: sass] Option 'file' is not allowed"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}