{"name":"rollup-plugin-esbuild","version":"6.2.1","packageManager":"pnpm@10.5.2","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{"import":"./dist/index.mjs","default":"./dist/index.js"},"author":{"name":"EGOIST"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/egoist/rollup-plugin-esbuild.git"},"scripts":{"test":"vitest","build":"tsup","dev":"tsup --watch","prepublishOnly":"pnpm run build"},"devDependencies":{"@types/debug":"^4.1.12","@types/node":"22.13.5","esbuild":"^0.25.0","prettier":"^3.5.2","react":"^19.0.0","rollup":"^4.34.8","ts-essentials":"^10.0.4","tsup":"^8.4.0","typescript":"^5.7.3","vitest":"^3.0.7","vue":"^3.5.13"},"dependencies":{"debug":"^4.4.0","es-module-lexer":"^1.6.0","get-tsconfig":"^4.10.0","unplugin-utils":"^0.2.4"},"peerDependencies":{"esbuild":">=0.18.0","rollup":"^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0"},"engines":{"node":">=14.18.0"},"_id":"rollup-plugin-esbuild@6.2.1","gitHead":"a9235042e65fbff231c7f3c4c1d8368454b1af27","description":"**💛 You can help the author become a full-time open-source maintainer by [sponsoring him on GitHub](https://github.com/sponsors/egoist).**","bugs":{"url":"https://github.com/egoist/rollup-plugin-esbuild/issues"},"homepage":"https://github.com/egoist/rollup-plugin-esbuild#readme","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-jTNOMGoMRhs0JuueJrJqbW8tOwxumaWYq+V5i+PD+8ecSCVkuX27tGW7BXqDgoULQ55rO7IdNxPcnsWtshz3AA==","shasum":"c556195465bf452965686e0f21adfe306b90c219","tarball":"http://registry-npm.ywwl.com/rollup-plugin-esbuild/download/rollup-plugin-esbuild-6.2.1.tgz","fileCount":7,"unpackedSize":26820,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICapS8RWXUSCVxpZnwO3L3jjcCyH7iZZpd4ZNo0qAl3hAiBAYbYYa3OBZ/TD/JtTd2lvmbXVYeYiuINKhSvUOm30TQ=="}],"size":6739,"noattachment":false,"key":"/rollup-plugin-esbuild/-/rollup-plugin-esbuild-6.2.1.tgz"},"_npmUser":{"name":"egoist","email":"0x142857@gmail.com"},"directories":{},"maintainers":[{"name":"egoist","email":"0x142857@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rollup-plugin-esbuild_6.2.1_1740628272600_0.48663008140308794"},"_hasShrinkwrap":false,"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":1740628272779,"_cnpm_publish_time":1740628272779,"dist-tags":{"latest":"6.2.1"}}