{"id":15470558,"url":"https://github.com/react18-tools/esbuild-plugin-react18-css","last_synced_at":"2025-04-10T10:14:54.097Z","repository":{"id":227912358,"uuid":"772521623","full_name":"react18-tools/esbuild-plugin-react18-css","owner":"react18-tools","description":"ESBuild plugin to handle CSS/SCSS modules, autoprefixer, etc.","archived":false,"fork":false,"pushed_at":"2024-10-29T08:25:19.000Z","size":578,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T09:47:05.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/react18-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["mayank1513"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://pages.razorpay.com/mayank1513"]}},"created_at":"2024-03-15T11:02:53.000Z","updated_at":"2024-10-29T08:25:23.000Z","dependencies_parsed_at":"2024-03-15T19:32:04.582Z","dependency_job_id":"7e0f2d2c-f421-434c-a357-03bf31b3e00c","html_url":"https://github.com/react18-tools/esbuild-plugin-react18-css","commit_stats":{"total_commits":663,"total_committers":1,"mean_commits":663.0,"dds":0.0,"last_synced_commit":"bc9a0b7c52b4e6f0e01e2dafee35d0ace99a9b97"},"previous_names":["react18-tools/esbuild-plugin-react18-css"],"tags_count":5,"template":false,"template_full_name":"react18-tools/turborepo-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react18-tools%2Fesbuild-plugin-react18-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react18-tools%2Fesbuild-plugin-react18-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react18-tools%2Fesbuild-plugin-react18-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react18-tools%2Fesbuild-plugin-react18-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react18-tools","download_url":"https://codeload.github.com/react18-tools/esbuild-plugin-react18-css/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248198893,"owners_count":21063628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T02:05:23.261Z","updated_at":"2025-04-10T10:14:54.077Z","avatar_url":"https://github.com/react18-tools.png","language":"TypeScript","funding_links":["https://github.com/sponsors/mayank1513","https://pages.razorpay.com/mayank1513"],"categories":[],"sub_categories":[],"readme":"# esbuild-plugin-react18-css\n\n[![test](https://github.com/react18-tools/esbuild-plugin-react18-css/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/esbuild-plugin-react18-css/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/4a09ba9315f3296c1524/maintainability)](https://codeclimate.com/github/react18-tools/esbuild-plugin-react18-css/maintainability) [![codecov](https://codecov.io/gh/react18-tools/esbuild-plugin-react18-css/graph/badge.svg)](https://codecov.io/gh/react18-tools/esbuild-plugin-react18-css) [![Version](https://img.shields.io/npm/v/esbuild-plugin-react18-css.svg?colorB=green)](https://www.npmjs.com/package/esbuild-plugin-react18-css) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/d18m/esbuild-plugin-react18-css.svg)](https://www.npmjs.com/package/esbuild-plugin-react18-css) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/esbuild-plugin-react18-css) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)\n\n\u003e [Featured packages built with this template.](./FEATURED.md)\n\n## Features\n\n✅ ESBuild plugin to handle CSS/SCSS modules, autoprefixer, etc.\n\n✅ Create fully treeshakable libraries (import from esbuild-plugin-react18-css/client/component)\n\n✅ Use CSS/SCSS modules - automatically converted to BEM like CSS\n\n✅ fully treeshakable CSS - import only the CSS files your users need\n\n✅ Full TypeScript Support\n\n✅ Unleash the full power of React18 Server components\n\n✅ Works with all build systems/tools/frameworks for React18\n\n✅ Doccumented with [Typedoc](https://react18-tools.github.io/esbuild-plugin-react18-css) ([Docs](https://react18-tools.github.io/esbuild-plugin-react18-css))\n\n## Install\n\n```bash\n$ pnpm add esbuild-plugin-react18-css\n```\n\nor\n\n```bash\n$ npm install esbuild-plugin-react18-css\n```\n\nor\n\n```bash\n$ yarn add esbuild-plugin-react18-css\n```\n\n## use with `tsup`\n\n```ts\n// tsup.config.ts or tsup.config.js\nimport { defineConfig } from \"tsup\";\nimport cssPlugin from \"esbuild-plugin-react18-css\";\n\nexport default defineConfig(options =\u003e ({\n    ...\n    esbuildPlugins:[cssPlugin()]\n}));\n```\n\n## use with esbuild\n\n```ts\nimport cssPlugin from \"esbuild-plugin-react18-css\";\n\nesbuild.build({\n  ...\n  plugins: [cssPlugin()],\n});\n```\n\n## CSSPluginOptions\n\n```tsx\ninterface CSSPluginOptions {\n  /**\n   * By default name is generated without hash so that it is easier and reliable for library users to override some CSS.\n   * Refer [loader-utils docs](https://github.com/webpack/loader-utils?tab=readme-ov-file#interpolatename) for more options\n   * @defaultValue A function that generates name similar to [name]__[local] but without .module\n   */\n  generateScopedName?: string | ((className: string, path: string, css: string) =\u003e string);\n  /** set skipAutoPrefixer to true to disable autoprefixer */\n  skipAutoPrefixer?: boolean;\n  /** global CSS class prefix. @defaultValue undefined */\n  globalPrefix?: string;\n  /** If you want to keep .module.css files. @defaultValue undefined */\n  keepModules?: boolean;\n}\n```\n\n### generateScopedName\n\nIt can be a string like `[name]__[local]___[hash:base64:5]` or `[name]__[local]` or `my-prefix__[name]__[local]`\n\nThe functions arguments are as follows.\n\n- css: the entire css file content\n- className: className from css file for the specific class\n- fileName: absolute fileName\n\n### 🤩 Don't forger to star [this repo](https://github.com/react18-tools/esbuild-plugin-react18-css)!\n\nWant hands-on course for getting started with Turborepo? Check out [React and Next.js with TypeScript](https://mayank-chaudhari.vercel.app/courses/react-and-next-js-with-typescript) and [The Game of Chess with Next.js, React and TypeScrypt](https://www.udemy.com/course/game-of-chess-with-nextjs-react-and-typescrypt/?referralCode=851A28F10B254A8523FE)\n\n![Repo Stats](https://repobeats.axiom.co/api/embed/b9f60aadc635649d8a66039094bcb26b5ccea1c1.svg \"Repobeats analytics image\")\n\n## License\n\nLicensed as MIT open source.\n\n\u003chr /\u003e\n\n\u003cp align=\"center\" style=\"text-align:center\"\u003ewith 💖 by \u003ca href=\"https://mayank-chaudhari.vercel.app\" target=\"_blank\"\u003eMayank Kumar Chaudhari\u003c/a\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact18-tools%2Fesbuild-plugin-react18-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact18-tools%2Fesbuild-plugin-react18-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact18-tools%2Fesbuild-plugin-react18-css/lists"}