impound
Build plugin to restrict import patterns in certain parts of your code-base.
This package is an unplugin which provides support for a wide range of bundlers.
Usage
Install package:
npm install impound
import { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
import { ImpoundPlugin } from 'impound'
export default {
plugins: [
ImpoundPlugin.rollup({
cwd: dirname(fileURLToPath(import.meta.url)),
include: [/src\/*/],
patterns: [
[/^node:.*/],
['@nuxt/kit', 'Importing from @nuxt kit is not allowed in your src/ directory']
]
}),
],
}
💻 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.