Skip to main content

Built and signed on GitHub Actions

Macros plugin for bundlers.

This package works with Node.js, BunIt is unknown whether this package works with Cloudflare Workers, Deno
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
It is unknown whether this package works with Deno
This package works with Bun
JSR Score
100%
Published
a week ago (0.14.0)
interface Options

Represents the options for the plugin.

Properties

optional
include: FilterPattern

The patterns of files to include.

optional
exclude: FilterPattern

The patterns of files to exclude.

optional
viteServer: ViteDevServer | false

The Vite dev server instance.

If not provided and the bundler is Vite, it will reuse the current dev server. If not provided, it will try to use viteConfig to create one.

optional
viteConfig: InlineConfig

The Vite configuration. Available when viteServer is not provided.

optional
enforce:
"pre"
| "post"
| undefined

Adjusts the plugin order (only works for Vite and Webpack).

optional
attrs: Record<string, string> = "type": "macro"

The mapping of import attributes.

Add Package

deno add jsr:@unplugin/macros

Import symbol

import { type Options } from "@unplugin/macros/api";

---- OR ----

Import directly with a jsr specifier

import { type Options } from "jsr:@unplugin/macros/api";

Add Package

npx jsr add @unplugin/macros

Import symbol

import { type Options } from "@unplugin/macros/api";

Add Package

yarn dlx jsr add @unplugin/macros

Import symbol

import { type Options } from "@unplugin/macros/api";

Add Package

pnpm dlx jsr add @unplugin/macros

Import symbol

import { type Options } from "@unplugin/macros/api";

Add Package

bunx jsr add @unplugin/macros

Import symbol

import { type Options } from "@unplugin/macros/api";