提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
liyanshuang dddd5f8a7a Merge branch 'dev' of http://39.101.133.168:8807/donghanyang/Dbqb_Study into dev 3 weeks ago
..
dist 吴光慧11.3学习笔记 3 weeks ago
LICENSE 吴光慧11.3学习笔记 3 weeks ago
README.md 吴光慧11.3学习笔记 3 weeks ago
package.json 吴光慧11.3学习笔记 3 weeks ago

README.md

unplugin-utils

npm version npm downloads Unit Test codecov

A set of utility functions commonly used by unplugins.

Thanks to @rollup/pluginutils. This projects is heavily copied from it.

Why Fork?

  • 🌍 Platform agnostic, supports running in the browser, Node.js...
  • ✂️ Subset, smaller bundle size.
  • 💯 Coverage: 100% test coverage.

Install

npm i unplugin-utils

Usage

createFilter

export default function myPlugin(options = {}) {
  const filter = createFilter(options.include, options.exclude)

  return {
    transform(code, id) {
      if (!filter(id)) return

      // proceed with the transformation...
    },
  }
}

normalizePath

import { normalizePath } from 'unplugin-utils'

normalizePath(String.raw`foo\bar`) // 'foo/bar'
normalizePath('foo/bar') // 'foo/bar'

Sponsors

License

MIT License © 2025-PRESENT Kevin Deng

MIT Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors)