Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
60
Frontend-Learner/node_modules/unplugin-utils/README.md
generated
vendored
Normal file
60
Frontend-Learner/node_modules/unplugin-utils/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# unplugin-utils [](https://npmjs.com/package/unplugin-utils) [](https://codecov.io/gh/sxzz/unplugin-utils)
|
||||
|
||||
[](https://github.com/sxzz/unplugin-utils/actions/workflows/unit-test.yml)
|
||||
|
||||
A set of utility functions commonly used by unplugins.
|
||||
|
||||
Thanks to [@rollup/pluginutils](https://github.com/rollup/plugins/tree/master/packages/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
|
||||
|
||||
```bash
|
||||
npm i unplugin-utils
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### createFilter
|
||||
|
||||
```ts
|
||||
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
|
||||
|
||||
```ts
|
||||
import { normalizePath } from 'unplugin-utils'
|
||||
|
||||
normalizePath(String.raw`foo\bar`) // 'foo/bar'
|
||||
normalizePath('foo/bar') // 'foo/bar'
|
||||
```
|
||||
|
||||
## Sponsors
|
||||
|
||||
<p align="center">
|
||||
<a href="https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg">
|
||||
<img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) License © 2025 [三咲智子 Kevin Deng](https://github.com/sxzz)
|
||||
|
||||
[MIT](./LICENSE) Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors)
|
||||
Loading…
Add table
Add a link
Reference in a new issue