0.2.2 • Published 3 months ago

impound v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

impound

npm version npm downloads Github Actions Codecov

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
npm install impound
// rollup.config.js
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:.*/], // disallows all node imports
        ['@nuxt/kit', 'Importing from @nuxt kit is not allowed in your src/ directory'] // custom error message
      ]
    }),
  ],
}

💻 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.

0.2.1

3 months ago

0.2.2

3 months ago

0.2.0

8 months ago

0.1.0

10 months ago

0.0.0

10 months ago