custodio
v0.0.1
Published
Builder-agnostic plugin to allow restricting import patterns in certain parts of your code-base.
Downloads
3
Readme
custodio
Builder-agnostic plugin to allow restricting import patterns in certain parts of your code-base.
Usage
Install package:
# npm
npm install custodio
import { dirname } from 'node:path'
import { CustodioPlugin } from 'custodio'
const build = await rollup({
input: 'entry.js',
plugins: [
CustodioPlugin.rollup({
cwd: dirname(import.meta.url),
include: [/src\/*/],
patterns: [
[/^node:.*/], // disallows all node imports
['@nuxt/kit', 'Importing from @nuxt kit is not allowed in your src/ directory'] // custom error message
]
}),
],
})
🚧 TODO
- [x] add docs
- [x] update playground
- [x] push to GitHub
- [ ] migrate to
unjs/
💻 Development
- Clone this repository
- Enable Corepack using
corepack enable
- Install dependencies using
pnpm install
- Run interactive tests using
pnpm dev
License
Made with ❤️
Published under MIT License.