An esbuild plugin for compiling Sass and SCSS files, supporting PostCSS, CSS modules, constructable stylesheets for custom elements, dynamic styles, and CSS result import for lit-element. Version 3.7.0 requires esbuild >=0.27.3 and sass-embedded ^1.97.3 as peer dependencies. Released actively, it offers caching, URL rewriting, pre-compiling for global resources, and support for Sass Embedded Async API. Key differentiators include lit-css output for web components, CSS module support, and the ability to use both sass and sass-embedded backends.
npm install esbuild-sass-pluginVerified import paths — ran on the pinned version, not inferred.
Shows basic esbuild build setup with the sass plugin, including loadPaths and caching.
Update esbuild and sass-embedded to compatible versions.
Replace `sass` with `sass-embedded` in your project dependencies.
Use `import type { SassPluginOptions } from 'esbuild-sass-plugin'`.Use `const { sassPlugin } = require('esbuild-sass-plugin')`.Set `type: 'lit-css'` in the plugin options.
Run `npm install sass-embedded@^1.97.3` or `yarn add sass-embedded@^1.97.3`.
Use `const { sassPlugin } = require('esbuild-sass-plugin')` instead of `const sassPlugin = require('esbuild-sass-plugin')`.Add `import './styles/index.scss'` in your JavaScript or TypeScript entry point.