esbuild plugin to add web polyfills to support node core modules and globals
There are several solutions out there to simulate a node environment in the browser. For example, Browserify and Parcel provide built-in polyfills, whereas Webpack 5 and Rollup use an extra configuration like rollup-plugin-node-polyfills
.
But, in our experience, most of these modules are outdated and are always missing something.
We created 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.
$ npm install --save-dev @geut/esbuild-plugin-brode
import brode from "@geut/esbuild-plugin-brode";
require('esbuild').buildSync({
entryPoints: [...],
bundle: true,
minify: true,
sourcemap: true,
target: ['chrome58', 'firefox57', 'safari11', 'edge16'],
outfile: 'out.js',
plugins: [
brode()
]
})
🐛 If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.
👥 Ideas and contributions to the project are welcome. You must follow this guideline.
MIT © A GEUT project