{"id":25405,"library":"esbuild-plugin-sass-modules","title":"esbuild-plugin-sass","description":"An esbuild plugin that enables importing SASS/SCSS files directly in JavaScript bundles, with optional CSS modules support (class name hashing). Current stable version is 0.0.3, with low release cadence. Key differentiator: simple setup for SASS compilation within esbuild without external build tools, and optional CSS modules via separate plugin variant. No TypeScript types included.","status":"active","version":"0.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/dzearing/esbuild-plugin-sass-modules","tags":["javascript","esbuild","plugin","sass","modules","typescript"],"install":[{"cmd":"npm install esbuild-plugin-sass-modules","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-sass-modules","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-sass-modules","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, required at runtime","package":"esbuild","optional":false}],"imports":[{"note":"CommonJS require works but ESM import is preferred for newer esbuild setups","wrong":"const sassPlugin = require('esbuild-plugin-sass')","symbol":"default","correct":"import sassPlugin from 'esbuild-plugin-sass'"}],"quickstart":{"code":"const esbuild = require('esbuild');\nconst sassPlugin = require('esbuild-plugin-sass');\nesbuild.build({\n  entryPoints: ['src/index.js'],\n  bundle: true,\n  outfile: 'dist/bundle.js',\n  plugins: [sassPlugin()],\n}).catch((e) => console.error(e.message));","lang":"javascript","description":"Shows how to use esbuild-plugin-sass to compile SASS files during esbuild bundling."},"warnings":[{"fix":"Switch to esbuild-plugin-sass-modules if CSS modules are needed.","message":"Plugin does not support CSS modules by default; use esbuild-plugin-sass-modules for hashed class names.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Run 'npm install sass' alongside esbuild-plugin-sass.","message":"Requires sass (dart-sass) to be installed; not bundled with the plugin.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Rename entry point or use external tools to rename the output.","message":"Output CSS file name is derived from entry point name; cannot be customized via options.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install sass: npm install sass","cause":"Missing peer dependency 'sass'.","error":"Error: Cannot find module 'sass'"},{"fix":"Use const sassPlugin = require('esbuild-plugin-sass'); for CommonJS, or check import statement.","cause":"Incorrect import; used default import when CommonJS require was intended, or vice versa.","error":"TypeError: sassPlugin is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}