{"id":25445,"library":"esbuild-sass-glob","title":"esbuild-sass-glob","description":"Adds glob pattern support to @import statements in SCSS/SASS files when using esbuild-sass-plugin. Version 1.0.8 allows using wildcards like `@import './**/*.scss'` with the plugin's precompile hook. Lightweight alternative to webpack glob loaders, focused solely on esbuild integration. Currently stable with no active development; relies on esbuild-sass-plugin (v2+) as a peer dependency.","status":"active","version":"1.0.8","language":"javascript","source_language":"en","source_url":"https://github.com/austen-wade/esbuild-sass-glob","tags":["javascript","esbuild","sass","glob","imports"],"install":[{"cmd":"npm install esbuild-sass-glob","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-sass-glob","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-sass-glob","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency; the plugin's precompile option is needed to invoke esbuild-sass-glob.","package":"esbuild-sass-plugin","optional":false}],"imports":[{"note":"ESM-only package; no CommonJS support. A default function is exported.","wrong":"const sassGlob = require('esbuild-sass-glob')","symbol":"default","correct":"import sassGlob from 'esbuild-sass-glob'"},{"note":"If using require in a CommonJS context, must grab .default due to ESM interop.","wrong":"const sassGlob = require('esbuild-sass-glob')","symbol":"sassGlob","correct":"const sassGlob = require('esbuild-sass-glob').default"},{"note":"TypeScript users should use `import type` for the options interface; it is not a runtime export.","wrong":"import { GlobbifyOptions } from 'esbuild-sass-glob'","symbol":"Type: GlobbifyOptions","correct":"import type { GlobbifyOptions } from 'esbuild-sass-glob'"}],"quickstart":{"code":"import sassPlugin from 'esbuild-sass-plugin';\nimport sassGlob from 'esbuild-sass-glob';\nimport esbuild from 'esbuild';\n\nesbuild.build({\n  entryPoints: ['src/index.scss'],\n  outfile: 'dist/bundle.css',\n  plugins: [\n    sassPlugin({\n      precompile: (source, pathname) => sassGlob(source, pathname),\n    }),\n  ],\n}).catch(() => process.exit(1));","lang":"javascript","description":"Configure esbuild with sass plugin and glob support for SCSS imports using precompile hook."},"warnings":[{"fix":"Ensure glob paths begin with './' or '../' to reference relative to the file.","message":"Glob patterns are resolved relative to the importing file's directory, not the project root. Use relative paths like './**/*.scss'.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Continue using @import or switch to a different glob tool supporting @use.","message":"Only @import statements are processed; @use and @forward are not supported. Migration to Sass's new module system will break globs.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider migrating to Dart Sass with @use and a different glob approach.","message":"Sass itself deprecated @import in favor of @use/@forward. This library only supports the deprecated syntax.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Ensure esbuild-sass-plugin is installed and precompile is set correctly.","message":"If esbuild-sass-plugin is not installed or the precompile option is not provided, glob expansion will not work and errors may be silent.","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":"Run 'npm install esbuild-sass-glob' in your project.","cause":"The package is not installed or is not in node_modules.","error":"Error: Cannot find module 'esbuild-sass-glob'"},{"fix":"Use 'import sassGlob from 'esbuild-sass-glob'' or 'const sassGlob = require('esbuild-sass-glob').default'","cause":"Incorrect import style; likely used import { sassGlob } instead of default import or used require without .default.","error":"TypeError: sassGlob is not a function"},{"fix":"Update esbuild-sass-plugin to v2 or later: 'npm install esbuild-sass-plugin@latest'","cause":"Using an older version of esbuild-sass-plugin (v1) that doesn't have precompile.","error":"Error: The option 'precompile' is not available in sassPlugin"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}