0.0.1 • Published 12 months ago

warp-esbuild-plugin v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

Warp Esbuild Plugin

Usage

Installation

npm i warp-esbuild-plugin

Usage

Place @warp-ds tags inside any of the files that Esbuild will bundle. Whereever @warp-ds tags are placed, this plugin will replace them with minified Warp CSS

import warpPlugin from "warp-esbuild-plugin";

await build({
  ...
  plugins: [warpPlugin()],
  ...
});

File scanning

Warp needs to scan your source files in search of classes to build css for. By default, js and ts files are not scanned and you will need to add a // @unocss-include comment to each file where you use Warp classes to instruct Warp to include them.

filter

You can provide a regex to determine which files should have @warp-ds tags replaced.

await build({
  ...
  plugins: [warpPlugin({ filter: /(content|fallback|src).*\.(ts|js)$/ })],
  ...
});