All Projects → egoist → Rollup Plugin Esbuild

egoist / Rollup Plugin Esbuild

Licence: mit
Use ESBuild with Rollup to transform ESNext and TypeScript code.

Programming Languages

typescript
32286 projects
esnext
17 projects

Labels

Projects that are alternatives of or similar to Rollup Plugin Esbuild

Rollup Plugin Styles
🎨 Universal Rollup plugin for styles: PostCSS, Sass, Less, Stylus and more.
Stars: ✭ 116 (-47.27%)
Mutual labels:  rollup
React Border Wrapper
A wrapper for placing elements along div borders.
Stars: ✭ 147 (-33.18%)
Mutual labels:  rollup
Rollup Plugin Alias
This module has moved and is now available at @rollup/plugin-alias / https://github.com/rollup/plugins
Stars: ✭ 175 (-20.45%)
Mutual labels:  rollup
Example Rollup React Component Npm Package
Example React Component, Published to npm
Stars: ✭ 122 (-44.55%)
Mutual labels:  rollup
Plugins
🍣 The one-stop shop for official Rollup plugins
Stars: ✭ 2,238 (+917.27%)
Mutual labels:  rollup
Rollupjs Note
《Rollup.js 实战学习笔记》已完结 😆
Stars: ✭ 152 (-30.91%)
Mutual labels:  rollup
Babel Plugin Prismjs
A babel plugin to use PrismJS with standard bundlers.
Stars: ✭ 114 (-48.18%)
Mutual labels:  rollup
Vue Plugin Template
🚀 Solid foundation to start a Vue plugin with the best developer experience and a focus on performance
Stars: ✭ 189 (-14.09%)
Mutual labels:  rollup
Klap
zero config, zero dependency bundler for tiny javascript packages
Stars: ✭ 143 (-35%)
Mutual labels:  rollup
Js Sdk
JavaScript & Node.js SDKs for the Elastic Path Commerce Cloud eCommerce API
Stars: ✭ 169 (-23.18%)
Mutual labels:  rollup
Callapp Lib
🔥call app from h5(H5唤起客户端 )
Stars: ✭ 1,857 (+744.09%)
Mutual labels:  rollup
Rollup Plugin Copy
Copy files and folders using Rollup
Stars: ✭ 128 (-41.82%)
Mutual labels:  rollup
React Rollup Boilerplate
Boilerplate for creating React component libraries, bundled with Rollup.js to ES6 Modules, React Styleguidist, Typescript
Stars: ✭ 157 (-28.64%)
Mutual labels:  rollup
Eleventy Starter
ARCHIVED: An Eleventy starting point with Tailwind and Svelte preconfigured.
Stars: ✭ 118 (-46.36%)
Mutual labels:  rollup
Front End Tooling Recipes
Collection of pre-configured front-end tooling setups for common uses.
Stars: ✭ 176 (-20%)
Mutual labels:  rollup
Rollup Plugin Filesize
A rollup plugin to show file size of the bundle in the cli
Stars: ✭ 114 (-48.18%)
Mutual labels:  rollup
Workflow
一个工作流平台
Stars: ✭ 1,888 (+758.18%)
Mutual labels:  rollup
Xdm
a modern MDX compiler. No runtime. With esbuild, Rollup, and webpack plugins
Stars: ✭ 206 (-6.36%)
Mutual labels:  rollup
Learn Rollup
This is an example project to accompany a tutorial on using Rollup.
Stars: ✭ 178 (-19.09%)
Mutual labels:  rollup
Tails Ui
🐒 Clean UI based on tailwindcss
Stars: ✭ 162 (-26.36%)
Mutual labels:  rollup

💛 You can help the author become a full-time open-source maintainer by sponsoring him on GitHub.


rollup-plugin-esbuild

npm version npm downloads

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.

Install

yarn add esbuild rollup-plugin-esbuild --dev

Usage

In rollup.config.js:

import esbuild from 'rollup-plugin-esbuild'

export default {
  plugins: [
    esbuild({
      // All options are optional
      include: /\.[jt]sx?$/, // default, inferred from `loaders` option
      exclude: /node_modules/, // default
      sourceMap: false, // default
      minify: process.env.NODE_ENV === 'production',
      target: 'es2017' // default, or 'es20XX', 'esnext'
      jsxFactory: 'React.createElement',
      jsxFragment: 'React.Fragment'
      // Like @rollup/plugin-replace
      define: {
        __VERSION__: '"x.y.z"'
      },
      tsconfig: 'tsconfig.json', // default
      // Add extra loaders
      loaders: {
        // Add .json files support
        // require @rollup/plugin-commonjs
        '.json': 'json',
        // Enable JSX in .js files too
        '.js': 'jsx'
      }
    }),
  ],
}
  • include and exclude can be String | RegExp | Array[...String|RegExp], when supplied it will override default values.
  • It uses jsxFactory, jsxFragmentFactory and target options from your tsconfig.json as default values.

Declaration File

There are serveral ways to generate declaration file:

  • Use tsc with emitDeclarationOnly, the slowest way but you get type checking, it doesn't bundle the .d.ts files.
  • Use rollup-plugin-dts which generates and bundle .d.ts, also does type checking.
  • Use api-extractor by Microsoft, looks quite complex to me so I didn't try it, PR welcome to update this section.

Use with Vue JSX

Use this with rollup-plugin-vue-jsx:

import vueJsx from 'rollup-plugin-vue-jsx-compat'
import esbuild from 'rollup-plugin-esbuild'

export default {
  // ...
  plugins: [
    vueJsx(),
    esbuild({
      jsxFactory: "vueJsxCompat",
    }),
  ],
}

License

MIT © EGOIST (Kevin Titor)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].