{"id":25291,"library":"esbuild-inline-sass","title":"esbuild-inline-sass","description":"An esbuild plugin that inlines SASS/SCSS files as injected <style> tags in the browser, eliminating the need for separate CSS files. Version 0.4.4 is the latest stable release, actively maintained with occasional dependency updates. It supports both ESM and CommonJS, ships TypeScript types, and differentiates from other esbuild CSS plugins by automatically creating a style element and appending compiled CSS to the DOM, supporting remote @imports via CDN. The only peer dependency is esbuild itself.","status":"active","version":"0.4.4","language":"javascript","source_language":"en","source_url":"https://github.com/ProdigyPXP/esbuild-inline-sass","tags":["javascript","esbuild","plugin","style","css","typescript"],"install":[{"cmd":"npm install esbuild-inline-sass","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-inline-sass","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-inline-sass","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency; the plugin runs during esbuild builds.","package":"esbuild","optional":false}],"imports":[{"note":"Default export does not exist; named import 'inlineSass' must be used. CommonJS users must destructure: const { inlineSass } = require('esbuild-inline-sass').","wrong":"const inlineSass = require('esbuild-inline-sass')","symbol":"inlineSass","correct":"import { inlineSass } from 'esbuild-inline-sass'"},{"note":"Alias for inlineSass; either can be used interchangeably. Both are valid named exports.","wrong":"const inlineScss = require('esbuild-inline-sass').inlineScss","symbol":"inlineScss","correct":"import { inlineScss } from 'esbuild-inline-sass'"},{"note":"TypeScript only; export is a type, must be imported with 'type' keyword or as type-only import.","wrong":"import { InlineSassOptions } from 'esbuild-inline-sass'","symbol":"InlineSassOptions","correct":"import type { InlineSassOptions } from 'esbuild-inline-sass'"}],"quickstart":{"code":"import { inlineSass } from 'esbuild-inline-sass';\nimport * as esbuild from 'esbuild';\n\nawait esbuild.build({\n  entryPoints: ['src/index.js'],\n  bundle: true,\n  outfile: 'dist/bundle.js',\n  plugins: [inlineSass({ minify: true })],\n});","lang":"javascript","description":"Shows how to use the plugin in an esbuild build pipeline to inline SCSS files."},"warnings":[{"fix":"Rename .css files to .scss or .sass, or preprocess them separately.","message":"Plugin expects .scss or .sass extension; .css files are not processed.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use only in client-side code; avoid importing styles in Node.js builds or provide a conditional check.","message":"Inline styles use document.createElement('style') which does not work in server-side environments (Node.js, SSR).","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"N/A","message":"Options object currently has no deprecated fields; no known deprecations at this version.","severity":"deprecated","affected_versions":"<0.4.4"},{"fix":"Ensure remote URLs are accessible at runtime, or bundle dependencies locally.","message":"Remote @import statements are not resolved by esbuild; plugin passes them through into the inline style tag.","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":"Call the function: plugins: [inlineSass({minify: true})]","cause":"Passing the plugin function directly instead of calling it (e.g., plugins: [inlineSass] instead of plugins: [inlineSass()]).","error":"Error: The plugin 'esbuild-inline-sass' is not valid. Expected an object with a name property."},{"fix":"Use const { inlineSass } = require('esbuild-inline-sass');","cause":"Using require('esbuild-inline-sass') without destructuring the named export in CommonJS.","error":"TypeError: _inlineSass.inlineSass is not a function"},{"fix":"Run 'npm install --save-dev esbuild-inline-sass' or check package.json.","cause":"Missing or incorrect installation; esbuild-inline-sass not in node_modules.","error":"Error: Cannot find module 'esbuild-inline-sass'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}