{"id":50686675,"url":"https://github.com/alextompkins/esbuild-plugin-jsximportsource","last_synced_at":"2026-06-08T23:31:31.621Z","repository":{"id":45770832,"uuid":"484235204","full_name":"alextompkins/esbuild-plugin-jsximportsource","owner":"alextompkins","description":"An esbuild plugin that allows use of the `@jsxImportSource` pragma. ","archived":false,"fork":false,"pushed_at":"2023-02-12T07:19:22.000Z","size":945,"stargazers_count":3,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-09T05:53:26.931Z","etag":null,"topics":["esbuild","esbuild-plugin","jsx"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/esbuild-plugin-jsximportsource","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alextompkins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-21T23:36:15.000Z","updated_at":"2023-03-04T03:35:02.000Z","dependencies_parsed_at":"2023-02-18T17:45:21.106Z","dependency_job_id":null,"html_url":"https://github.com/alextompkins/esbuild-plugin-jsximportsource","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/alextompkins/esbuild-plugin-jsximportsource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextompkins%2Fesbuild-plugin-jsximportsource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextompkins%2Fesbuild-plugin-jsximportsource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextompkins%2Fesbuild-plugin-jsximportsource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextompkins%2Fesbuild-plugin-jsximportsource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alextompkins","download_url":"https://codeload.github.com/alextompkins/esbuild-plugin-jsximportsource/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextompkins%2Fesbuild-plugin-jsximportsource/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34085321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["esbuild","esbuild-plugin","jsx"],"created_at":"2026-06-08T23:31:30.532Z","updated_at":"2026-06-08T23:31:31.615Z","avatar_url":"https://github.com/alextompkins.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esbuild-plugin-jsximportsource\n\n[![test](https://github.com/alextompkins/esbuild-plugin-jsximportsource/actions/workflows/test.yml/badge.svg)](https://github.com/alextompkins/esbuild-plugin-jsximportsource/actions/workflows/test.yml)\n\nAn esbuild plugin to support the `@jsxImportSource` pragma.\n\n**OBSOLETE**: I am retiring this plugin because [support for the automatic JSX runtime has landed in esbuild as of v0.14.51](https://github.com/evanw/esbuild/releases/tag/v0.14.51). \n\n**BREAKING CHANGE**: v1 of this plugin exports only an ESM entrypoint. \nThis means it will only work using `import` syntax. \nIf you need to use this plugin from a CJS build script, you have two options:\n1. Use a [dynamic import](https://nodejs.org/api/esm.html#import-expressions), which is supported by Node 12+.\n2. Use v0, which exports a CJS entrypoint that you can `require()`. \n\n## Install\n```\nnpm i esbuild-plugin-jsximportsource\n```\n\n## Usage\nJust add it to your esbuild plugins:\n\n```js\nimport { jsxImportSourcePlugin } from 'esbuild-plugin-jsximportsource';\n\nawait esbuild.build({\n  ...\n  plugins: [jsxImportSourcePlugin()]\n});\n```\n\nThis will replace `@jsxImportSource` with an import from the specified package and the `@jsx` pragma, which [esbuild supports natively](https://github.com/evanw/esbuild/issues/138). \n\nBy default, this will only transform `.jsx` or `.tsx` files. You can change this by specifying a custom filter:\n```js\nawait esbuild.build({\n  ...\n  plugins: [jsxImportSourcePlugin({ filter: /.(js|ts|jsx|tsx)/ })]\n});\n```\n\n## Example\n```tsx\n/** @jsxImportSource @emotion/react */\nimport { css } from '@emotion/react';\n\nexport const Component = () =\u003e (\n  \u003cdiv\n    css={css`\n      background-color: hotpink;\n    `}\n  \u003e\n    Hello!\n  \u003c/div\u003e\n);\n\n```\nbecomes:\n```tsx\n/** @jsx jsx */\nimport { jsx } from '@emotion/react';\nimport { css } from '@emotion/react';\n\nexport const Component = () =\u003e (\n  \u003cdiv\n    css={css`\n      background-color: hotpink;\n    `}\n  \u003e\n    Hello!\n  \u003c/div\u003e\n);\n```\n\nwhich gets transpiled to:\n```js\nimport { jsx } from \"@emotion/react\";\nimport { css } from \"@emotion/react\";\nexport const Component = () =\u003e /* @__PURE__ */ jsx(\"div\", {\n  css: css`\n      background-color: hotpink;\n    `\n}, \"Hello!\");\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextompkins%2Fesbuild-plugin-jsximportsource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextompkins%2Fesbuild-plugin-jsximportsource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextompkins%2Fesbuild-plugin-jsximportsource/lists"}