{"id":40937,"library":"esbuild-plugin-postcss-literal","title":"esbuild-plugin-postcss-literal","description":"PostCSS tagged template literals plugin for esbuild (v0.2.1). Enables processing CSS-in-JS tagged template literals (e.g., css`...`) through PostCSS pipelines during esbuild builds. Integrates with postcss-load-config for plugin configuration (e.g., postcss-nesting). Provides options like filter, namespace, tag name, and minify. Requires esbuild ^0.9.0, postcss ^8.0.0, and postcss-load-config ^3.0.0 as peer dependencies. Different from other PostCSS esbuild plugins by focusing specifically on template literals rather than CSS files.","status":"active","version":"0.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/nativew/esbuild-plugin-postcss-literal","tags":["javascript","postcss","postcss-runner","esbuild","esbuild-plugin","css","style","literal","css-in-js"],"install":[{"cmd":"npm install esbuild-plugin-postcss-literal","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-postcss-literal","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-postcss-literal","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: esbuild plugin interface","package":"esbuild","optional":false},{"reason":"peer dependency: PostCSS processor","package":"postcss","optional":false},{"reason":"peer dependency: loads PostCSS config from .postcssrc","package":"postcss-load-config","optional":false}],"imports":[{"note":"This package exports a default function (factory), not a named export.","wrong":"import { postcssLiteral } from 'esbuild-plugin-postcss-literal'","symbol":"default","correct":"import postcssLiteral from 'esbuild-plugin-postcss-literal'"},{"note":"When using CommonJS, the default export is accessed as require() directly, not destructured.","wrong":"const { postcssLiteral } = require('esbuild-plugin-postcss-literal')","symbol":"postcssLiteral","correct":"const postcssLiteral = require('esbuild-plugin-postcss-literal')"},{"note":"TypeScript's import = require is not needed; use default import syntax for ESM.","wrong":"import postcssLiteral = require('esbuild-plugin-postcss-literal')","symbol":"postcssLiteral","correct":"import postcssLiteral from 'esbuild-plugin-postcss-literal'"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport postcssLiteral from 'esbuild-plugin-postcss-literal';\n\nawait esbuild.build({\n  entryPoints: ['src/index.js'],\n  bundle: true,\n  outfile: 'dist/main.js',\n  plugins: [postcssLiteral()],\n});","lang":"typescript","description":"Shows basic usage: import plugin, add to esbuild build plugins array. Requires postcss-load-config or inline config."},"warnings":[{"fix":"Use explicit filter and tag options to avoid unintended processing.","message":"Plugin processes files matching filter (default /.*/) and namespace. Ensure entry points contain tagged template literals with the default tag 'css'.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set minify: false and handle minification separately if needed.","message":"Minify option uses esbuild to minify output CSS, but may conflict with other minification plugins.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Run npm install esbuild postcss postcss-load-config --save-dev.","message":"Peer dependencies not installed automatically; must be installed manually.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Add 'dom' to lib array in tsconfig.json.","message":"If using TypeScript, ensure tsconfig includes 'dom' lib for template literals or appropriate type definitions.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.9.0':55 '3.0.0':63 '8.0.0':57 'build':30 'config':36,62 'configur':39 'css':17,24,81,92,96 'css-in-j':16,95 'depend':66 'differ':67 'e.g':23,40 'enabl':14 'esbuild':2,12,29,54,71,88,90 'esbuild-plugin':89 'esbuild-plugin-postcss-liter':1 'file':82 'filter':47 'focus':74 'integr':31 'javascript':83 'js':19,98 'like':46 'liter':5,9,22,78,94 'load':35,61 'minifi':52 'name':50 'namespac':48 'nest':43 'option':45 'peer':65 'pipelin':27 'plugin':3,10,38,72,91 'postcss':4,6,26,34,42,56,60,70,84,86 'postcss-load-config':33,59 'postcss-nest':41 'postcss-runn':85 'process':15 'provid':44 'rather':79 'requir':53 'runner':87 'specif':75 'style':93 'tag':7,20,49 'templat':8,21,77 'v0.2.1':13","created_at":"2026-06-04T18:49:58.999511+00:00","updated_at":"2026-06-04T18:49:58.999511+00:00","problems":[{"fix":"Install postcss-load-config via npm install postcss-load-config --save-dev.","cause":"Missing peer dependency postcss-load-config.","error":"Error: Cannot find module 'postcss-load-config'"},{"fix":"Create a .postcssrc file or pass config option to postcssLiteral().","cause":"No .postcssrc, postcss.config.js, or inline config provided.","error":"Error: No configuration found for postcss plugin"},{"fix":"Ensure plugin filter only matches files that contain template literals (e.g., filter: /\\.js$/).","cause":"Attempting to process non-JS files (e.g., .css) that are not handled by this plugin.","error":"Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type."},{"fix":"Use import postcssLiteral from 'esbuild-plugin-postcss-literal' (default import).","cause":"Incorrect import: used named import instead of default.","error":"TypeError: postcssLiteral is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/nativew/esbuild-plugin-postcss-literal#readme","github":"https://github.com/nativew/esbuild-plugin-postcss-literal","docs":null,"changelog":null,"pypi":null,"npm":"esbuild-plugin-postcss-literal","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}