npm package: @geut/esbuild-plugin-brode
Description: esbuild plugin to add web polyfills to support node core modules and globals
Author: GEUT
Latest version: 2.0.14

# esbuild-plugin-brode
esbuild plugin to add web polyfills to support node core modules and globals

![Test Status](https://github.com/geut/brode/actions/workflows/test.yml/badge.svg)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)

[![Made by GEUT][geut-badge]][geut-url]

## Why

There a several solutions out there to simulate a node environment in the browser. For example, Browserify and Parcel provides built-in polyfills, Webpack 5 and Rollup needs extra configuration like `rollup-plugin-node-polyfills`.

But in our experience most of this modules are outdated and it's always missing something.

We create this plugin for esbuild to provide a opinionated setup of web polyfills to support node modules that we want and we need in our apps.

## Install

```bash
$ npm install --save-dev @geut/esbuild-plugin-brode
```

## Usage

```javascript
const brode = require('@geut/esbuild-plugin-brode')

require('esbuild').buildSync({
  entryPoints: [...],
  bundle: true,
  minify: true,
  sourcemap: true,
  target: ['chrome58', 'firefox57', 'safari11', 'edge16'],
  outfile: 'out.js',
  plugins: [
    brode()
  ]
})
```

## Issues

:bug: If you found an issue we encourage you to report it on [github](https://github.com/geut/brode/issues). Please specify your OS and the actions to reproduce it.

## Contributing

:busts_in_silhouette: Ideas and contributions to the project are welcome. You must follow this [guideline](https://github.com/geut/brode/blob/main/CONTRIBUTING.md).

## License

MIT © A [**GEUT**](http://geutstudio.com/) project

[geut-url]: https://geutstudio.com
[geut-badge]: https://img.shields.io/badge/Made%20By-GEUT-4f5186?style=for-the-badge&link=https://geutstudio.com&labelColor=white&logo=data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2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