https://github.com/webdeveric/esbuild-plugin-modify-entrypoints
esbuild plugin to modify the contents of your entrypoints
https://github.com/webdeveric/esbuild-plugin-modify-entrypoints
esbuild-plugin plugin
Last synced: 2 months ago
JSON representation
esbuild plugin to modify the contents of your entrypoints
- Host: GitHub
- URL: https://github.com/webdeveric/esbuild-plugin-modify-entrypoints
- Owner: webdeveric
- License: mit
- Created: 2023-04-26T19:24:33.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T00:03:18.000Z (12 months ago)
- Last Synced: 2025-02-12T10:17:45.420Z (3 months ago)
- Topics: esbuild-plugin, plugin
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/esbuild-plugin-modify-entrypoints
- Size: 269 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# `esbuild-plugin-modify-entrypoints`
[](https://github.com/webdeveric/esbuild-plugin-modify-entrypoints/actions)
## Install
```sh
npm install esbuild-plugin-modify-entrypoints -D
```## Usage
Add the plugin to your esbuild `plugins`.
```ts
import { build } from 'esbuild';import { modifyEntrypointsPlugin } from 'esbuild-plugin-modify-entrypoints';
const results = await build({
entryPoints: ['your-file.ts'],
plugins: [
modifyEntrypointsPlugin(({ contents }) => {
return {
contents: `console.log('First');\n${contents}`,
loader: 'ts',
};
}),
],
});
```