@wyw-in-js/bun
v2.4.1
Published
The package contains WyW-in-JS plugin for [Bun](https://bun.sh/) bundler.
Downloads
931
Readme
@wyw-in-js/bun
The package contains WyW-in-JS plugin for Bun bundler.
Installation
# npm
npm i -D @wyw-in-js/bun
# yarn
yarn add --dev @wyw-in-js/bun
# pnpm
pnpm add -D @wyw-in-js/bun
# bun
bun add -d @wyw-in-js/bunUsage
import wyw from '@wyw-in-js/bun';
await Bun.build({
entrypoints: ['src/index.ts'],
outdir: 'dist',
plugins: [wyw()],
});Eval resolver modes
eval.resolver: 'native' and the native step of eval.resolver: 'hybrid' use oxc-resolver with automatic
tsconfig.json discovery.
The Bun plugin does not receive a static bundler alias map. Use hybrid when evaluated imports may rely on Bun-specific
resolution. Use native only when oxc-resolver can resolve all evaluated imports, or mirror Bun-only aliases in
oxcOptions.resolver.alias.
Transforming libraries in node_modules
By default, the Bun plugin skips transforming files from node_modules for performance.
To transform a specific library, enable transformLibraries and narrow include/exclude:
wyw({
transformLibraries: true,
include: [/node_modules\\/(?:@fluentui)\\//],
});Disabling vendor prefixing
Stylis adds vendor-prefixed CSS by default. To disable it (and reduce CSS size), pass prefixer: false:
wyw({
prefixer: false,
});To get details about supported options by the plugin, please check documentation.
