package
A set of utility functions commonly used by unplugins.
npm install unplugin-utilsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 3 packages.
151.4 kB
Includes dependencies.
A set of utility functions commonly used by unplugins.
Thanks to @rollup/pluginutils. This projects is heavily copied from it.
npm i unplugin-utilsexport default function myPlugin(options = {}) {
const filter = createFilter(options.include, options.exclude)
return {
transform(code, id) {
if (!filter(id)) return
// proceed with the transformation...
},
}
}import { normalizePath } from 'unplugin-utils'
normalizePath(String.raw`foo\bar`) // 'foo/bar'
normalizePath('foo/bar') // 'foo/bar'MIT License © 2025-PRESENT Kevin Deng
MIT Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors)