esbuild-plugin-realpath
v1.4.15
Published
A plugin to resolve the fs.realpath for modules in monorepos targeting the browser and node
Maintainers
Readme
esbuild-plugin-realpath
A plugin that resolves the real filesystem path for modules in monorepos targeting the browser or Node.js.
Installation
npm install esbuild esbuild-plugin-realpathRun this in an esbuild project that has src/index.js:
const esbuild = require('esbuild');
const realpath = require('esbuild-plugin-realpath');
esbuild.build({
entryPoints: ['./src/index.js'],
bundle: true,
outfile: './public/bundle.js',
plugins: [realpath()],
});The plugin uses browser resolution for browser builds and Node resolution for Node builds. It resolves each module path once and writes the bundled output to public/bundle.js in this example.
Examples
License
MIT
