{"id":25446,"library":"esbuild-sass-plugin-ysink","title":"esbuild-sass-plugin (ysink fork)","description":"Fork of esbuild-sass-plugin (v2.3.4, actively maintained) adding CSS modules support without auto-injection, plus a shelter mode for Discord scoped APIs. Differentiates from upstream by allowing `inject: false` for modules and `inject: 'shelter'` for unloading. Ships TypeScript types, supports postcss, and targets esbuild plugin ecosystem.","status":"active","version":"2.3.4","language":"javascript","source_language":"en","source_url":"https://github.com/yellowink/esbuild-sass-plugin","tags":["javascript","esbuild","plugin","sass","scss","css","postcss","css-modules","typescript"],"install":[{"cmd":"npm install esbuild-sass-plugin-ysink","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-sass-plugin-ysink","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-sass-plugin-ysink","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Sass compiler for .scss/.sass files","package":"sass","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require will fail.","wrong":"const sassPlugin = require('esbuild-sass-plugin-ysink')","symbol":"sassPlugin","correct":"import { sassPlugin } from 'esbuild-sass-plugin-ysink'"},{"note":"Named export, not default. Must be destructured.","wrong":"const postcssModules = require('esbuild-sass-plugin-ysink').postcssModules","symbol":"postcssModules","correct":"import { postcssModules } from 'esbuild-sass-plugin-ysink'"},{"note":"Default import also works but named import is preferred for TypeScript.","wrong":"","symbol":"sassPlugin","correct":"import sassPlugin from 'esbuild-sass-plugin-ysink'"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport { sassPlugin, postcssModules } from 'esbuild-sass-plugin-ysink';\n\nawait esbuild.build({\n  entryPoints: ['src/app.ts'],\n  bundle: true,\n  outfile: 'dist/app.js',\n  plugins: [\n    sassPlugin({\n      filter: /\\.scss$/,\n      transform: postcssModules({\n        inject: false, // CSS modules without auto-injection\n        localsConvention: 'camelCase'\n      })\n    })\n  ]\n});","lang":"typescript","description":"Builds a TypeScript app with SCSS and CSS modules using esbuild, injecting CSS as text string."},"warnings":[{"fix":"Pin version if stability needed.","message":"Plugin options may change between minor versions; check changelog for breaking changes.","severity":"deprecated","affected_versions":">=2.0"},{"fix":"Use `type: 'css-text'` in esbuild config or manually inject via style tag.","message":"When using `inject: false`, CSS modules return a string of CSS; you must handle insertion manually.","severity":"gotcha","affected_versions":">=2.0"},{"fix":"Update to new transform signature.","message":"In v2.0, the transform API changed from `postcssModules()` to accept options object directly.","severity":"breaking","affected_versions":">=2.0 <2.0"},{"fix":"Set `inject: false` or `inject: 'shelter'` as needed.","message":"Older `inject: true` default is deprecated; future versions may require explicit `inject` setting.","severity":"deprecated","affected_versions":">=2.3"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install esbuild-sass-plugin-ysink` and ensure import path matches.","cause":"Package not installed or incorrect import path.","error":"Error: Cannot find module 'esbuild-sass-plugin-ysink'"},{"fix":"Use `import { sassPlugin } from 'esbuild-sass-plugin-ysink'`.","cause":"Importing default instead of named or using wrong package.","error":"TypeError: sassPlugin is not a function"},{"fix":"Import postcssModules: `import { postcssModules } from 'esbuild-sass-plugin-ysink'` and pass as transform function.","cause":"postcssModules not imported or used incorrectly.","error":"Error: Unsupported transform: postcssModules is not a function"},{"fix":"Add `inject: false` or `inject: 'shelter'` to postcssModules options.","cause":"Missing `inject` property in postcssModules options.","error":"Error: [plugin: esbuild-sass-plugin] Expected 'inject' option"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}