Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
esbuild-ignore-with-comments-plugin
Advanced tools
esbuild Plugin for ignoring files with specific comments in them
Allows inserting comments into TypeScript source files. ESBuild will ignore these files during build.
Add to any .ts
or .tsx
file the following comment:
/* esbuild-ignore */
This file will be replaced with a source file that has an empty object as a default export.
Configure the plugin for esbuild as follows:
import ignorePlugin from 'esbuild-ignore-with-comments-plugin';
import { build } from 'esbuild';
await build({
plugins: [ignorePlugin()],
});
If you are bundling the same files multiple times (such as for server-side rendering) you can group files into sets and only ignore specific sets of files.
For instance, assume you have the following files:
server.ts
/* esbuild-ignore ui */
// some server only stuff
ui.ts
/* esbuild-ignore server */
// some ui only stuff
Then running the following will ignore server.ts
during the build:
await build({
plugins: [ignorePlugin(['ui'])],
});
Note that files that have the comment /* esbuild-ignore */
without specifying a group will always be ignored.
Also note that if you want to add a file to multiple groups, you need to include multiple esbuild-ignore
comments, such as:
/* esbuild-ignore server */
/* esbuild-ignore ui */
FAQs
esbuild Plugin for ignoring files with specific comments in them
We found that esbuild-ignore-with-comments-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.