{"name":"rollup-plugin-esbuild","version":"6.2.0","author":{"name":"EGOIST"},"license":"MIT","_id":"rollup-plugin-esbuild@6.2.0","maintainers":[{"name":"egoist","email":"0x142857@gmail.com"}],"homepage":"https://github.com/egoist/rollup-plugin-esbuild#readme","bugs":{"url":"https://github.com/egoist/rollup-plugin-esbuild/issues"},"dist":{"shasum":"48d3a4eb5cef3098db78170e72601983c25c55cc","tarball":"http://registry-npm.ywwl.com/rollup-plugin-esbuild/download/rollup-plugin-esbuild-6.2.0.tgz","fileCount":7,"integrity":"sha512-LbkHaCahA6ceyWzAd6md2yajNS+HfZmZ5o58ShkZp0cQeZOnZECG2D2xWFNBq5SF6X6pfMK2udkZ+wRtvpzyVQ==","signatures":[{"sig":"MEUCIBvTqLa8ozRIXX2zf+4mqkXO7AbWq8E029D2eRL1bIDGAiEAmvAx1tmYylBlSYfN/PTQ7WIfdG7v/aJkxmM11Uuff/s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26948,"size":6748,"noattachment":false,"key":"/rollup-plugin-esbuild/-/rollup-plugin-esbuild-6.2.0.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=14.18.0"},"exports":{"import":"./dist/index.mjs","default":"./dist/index.js"},"gitHead":"f5744357544652ece33372a7b4f76b477430b2ed","scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"egoist","email":"0x142857@gmail.com"},"repository":{"url":"git+https://github.com/egoist/rollup-plugin-esbuild.git","type":"git"},"_npmVersion":"10.9.2","description":"**💛 You can help the author become a full-time open-source maintainer by [sponsoring him on GitHub](https://github.com/sponsors/egoist).**","directories":{},"_nodeVersion":"22.13.1","dependencies":{"debug":"^4.4.0","get-tsconfig":"^4.10.0","unplugin-utils":"^0.2.3","es-module-lexer":"^1.6.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.2.0","devDependencies":{"vue":"^3.5.13","tsup":"^8.3.6","react":"^19.0.0","rollup":"^4.34.4","vitest":"^3.0.5","esbuild":"^0.24.2","prettier":"^3.4.2","typescript":"^5.7.3","@types/node":"22.13.1","@types/debug":"^4.1.12","ts-essentials":"^10.0.4"},"peerDependencies":{"rollup":"^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0","esbuild":">=0.18.0"},"_npmOperationalInternal":{"tmp":"tmp/rollup-plugin-esbuild_6.2.0_1738799433612_0.28377227400022464","host":"s3://npm-registry-packages-npm-production"},"readme":"**💛 You can help the author become a full-time open-source maintainer by [sponsoring him on GitHub](https://github.com/sponsors/egoist).**\n\n---\n\n# rollup-plugin-esbuild\n\n![npm version](https://badgen.net/npm/v/rollup-plugin-esbuild) ![npm downloads](https://badgen.net/npm/dm/rollup-plugin-esbuild)\n\n[esbuild](https://github.com/evanw/esbuild) is by far one of the fastest TS/ESNext to ES6 compilers and minifier, this plugin replaces `rollup-plugin-typescript2`, `@rollup/plugin-typescript` and `rollup-plugin-terser` for you.\n\n## Install\n\n```bash\nyarn add esbuild rollup-plugin-esbuild --dev\n```\n\n## Usage\n\nIn `rollup.config.js`:\n\n```js\nimport esbuild from 'rollup-plugin-esbuild'\n\nexport default {\n  plugins: [\n    esbuild({\n      // All options are optional\n      include: /\\.[jt]sx?$/, // default, inferred from `loaders` option\n      exclude: /node_modules/, // default\n      sourceMap: true, // default\n      minify: process.env.NODE_ENV === 'production',\n      target: 'es2017', // default, or 'es20XX', 'esnext'\n      jsx: 'transform', // default, or 'preserve'\n      jsxFactory: 'React.createElement',\n      jsxFragment: 'React.Fragment',\n      // Like @rollup/plugin-replace\n      define: {\n        __VERSION__: '\"x.y.z\"',\n      },\n      tsconfig: 'tsconfig.json', // default\n      // Add extra loaders\n      loaders: {\n        // Add .json files support\n        // require @rollup/plugin-commonjs\n        '.json': 'json',\n        // Enable JSX in .js files too\n        '.js': 'jsx',\n      },\n    }),\n  ],\n}\n```\n\n- `include` and `exclude` can be `String | RegExp | Array[...String|RegExp]`, when supplied it will override default values.\n- It uses `jsx`, `jsxDev`, `jsxFactory`, `jsxFragmentFactory` and `target` options from your `tsconfig.json` as default values.\n\n### Declaration File\n\nThere are serveral ways to generate declaration file:\n\n- Use `tsc` with `emitDeclarationOnly`, the slowest way but you get type checking, it doesn't bundle the `.d.ts` files.\n- Use [`rollup-plugin-dts`](https://github.com/Swatinem/rollup-plugin-dts) which generates and bundle `.d.ts`, also does type checking.\n- Use [`api-extractor`](https://api-extractor.com/) by Microsoft, looks quite complex to me so I didn't try it, PR welcome to update this section.\n\n### Use with Vue JSX\n\nUse this with [rollup-plugin-vue-jsx](https://github.com/xxholly32/rollup-plugin-vue-jsx):\n\n```js\nimport vueJsx from 'rollup-plugin-vue-jsx-compat'\nimport esbuild from 'rollup-plugin-esbuild'\n\nexport default {\n  // ...\n  plugins: [\n    vueJsx(),\n    esbuild({\n      jsxFactory: 'vueJsxCompat',\n    }),\n  ],\n}\n```\n\n### Standalone Minify Plugin\n\nIf you only want to use this plugin to minify your bundle:\n\n```js\nimport { minify } from 'rollup-plugin-esbuild'\n\nexport default {\n  plugins: [minify()],\n}\n```\n\n### Optimizing Deps\n\nYou can use this plugin to pre-bundle dependencies using esbuild and inline them in the Rollup-generated bundle:\n\n```js\nesbuild({\n  optimizeDeps: {\n    include: ['vue', 'vue-router'],\n  },\n})\n```\n\nThis eliminates the need of `@rollup/plugin-node-modules` and `@rollup/plugin-commonjs`.\n\nNote that this is an **experimental features**, breaking changes might happen across minor version bump.\n\nTODO: Maybe we can scan Rollup input files to get a list of deps to optimize automatically.\n\n## Sponsors\n\n[![sponsors](https://sponsors-images.egoist.sh/sponsors.svg)](https://github.com/sponsors/egoist)\n\n## License\n\nMIT &copy; [EGOIST (Kevin Titor)](https://github.com/sponsors/egoist)\n","publish_time":1738799433792,"_cnpm_publish_time":1738799433792,"dist-tags":{"latest":"6.2.1"}}