Turborepo template
ESBuild plugin to ignore/exclude test files from build.
While building large libraries, we follow convention similar to chakraui
-> component and corresponding tests for the component live in the same dedicated folder. In this scenario, tsup
will build and include test file as well in the final build output. This is not desirable. This plugin will easily ignore test files from build process. You can also pass in custom regexp to ignore other files based on path.
Compatibility
- JavaScript/TypeScript React libraries using
tsup
or other builders based on esbuild
This plugin seamlessly integrates with tsup
and any other builders based on esbuild
.
Install
$ pnpm add esbuild-plugin-ignoretests
$ npm install esbuild-plugin-ignoretests
$ yarn add esbuild-plugin-ignoretests
Usage
import { defineConfig } from "tsup";
import ignoretestsPlugin from "esbuild-plugin-ignoretests";
export default defineConfig(options => ({
...
esbuildPlugins:[ignoretestsPlugin()]
}));
optionally you can also pass custom regular expression.
export default defineConfig(options => ({
...
esbuildPlugins:[ignoretestsPlugin({ customRegExp: /my-reg-exp/ })]
}));
🤩 Don't forger to start this repo!
Want handson course for getting started with Turborepo? Check out React and Next.js with TypeScript
License
Licensed as MIT open source.
with 💖 by Mayank Kumar Chaudhari