unplugin-utils is a lean, platform-agnostic library providing essential utility functions specifically designed for developing 'unplugins'—plugins that aim for universal compatibility across various JavaScript bundlers like Vite, Webpack, Rollup, and esbuild. It offers common helpers such as `createFilter` for efficient file path inclusion/exclusion matching and `normalizePath` for consistent path handling across different operating systems. The current stable version is 0.3.1, and the project is actively maintained with frequent minor updates and occasional breaking changes. Its key differentiators include a focus on platform agnosticism (supporting browser and Node.js environments), a smaller bundle footprint compared to alternatives due to a carefully selected subset of functionalities, and a commitment to 100% test coverage. The library is heavily inspired by and incorporates concepts from `@rollup/pluginutils` but is tailored for broader 'unplugin' ecosystem needs.
npm install unplugin-utilsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a basic unplugin using `createFilter` and `normalizePath` to conditionally transform code based on file paths.
Migrate your project to use ES module import syntax (`import ... from 'unplugin-utils'`). Ensure your build configuration supports ESM.
Upgrade your Node.js environment to version 20.19.0 or newer to ensure compatibility.
Review any custom path handling logic in your unplugins. It is recommended to consistently use `normalizePath` from `unplugin-utils` to ensure cross-platform compatibility.
Consult the changelog for v0.2.0 on GitHub to identify the specific renamed function and update your code accordingly.
Update your import statements from `const { someUtil } = require('unplugin-utils')` to `import { someUtil } from 'unplugin-utils'`.Refactor your imports to use ES module syntax: `import { createFilter } from 'unplugin-utils'` and ensure your project's `package.json` specifies `"type": "module"` or uses `.mjs` files.Upgrade your Node.js runtime to version 20.19.0 or a later compatible version.
Refer to the v0.2.0 changelog to identify the renamed function. Update your code to use the new function name.
No dependency data recorded yet.