Esbuild Plugin Require Resolve • A file loader plugin for esbuild for `require.resolve` statements.
How it works
Esbuild Plugin Require Resolve looks for require.resolve('path/to/file.png')
statements in JavaScript and TypeScript files and instructs esbuild to copy referenced files.
Install
npm i @chialab/esbuild-plugin-require-resolve -D
yarn add @chialab/esbuild-plugin-require-resolve -D
Usage
import esbuild from 'esbuild';
import requireResolvePlugin from '@chialab/esbuild-plugin-require-resolve';
await esbuild.build({
plugins: [
requireResolvePlugin(),
],
});
License
Esbuild Plugin Require Resolve is released under the MIT license.