Skip to content

Commit

Permalink
docs: improve example
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Aug 30, 2024
1 parent 4ad7be0 commit 158ff91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Github Actions][github-actions-src]][github-actions-href]
[![Codecov][codecov-src]][codecov-href]

> Builder-agnostic plugin to allow restricting import patterns in certain parts of your code-base.
> Build plugin to restrict import patterns in certain parts of your code-base.
This package is an [unplugin](https://unplugin.unjs.io/) which provides support for a wide range of bundlers.

Expand All @@ -21,12 +21,13 @@ npm install impound
```js
// rollup.config.js
import { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
import { ImpoundPlugin } from 'impound'

export default {
plugins: [
ImpoundPlugin.rollup({
cwd: dirname(import.meta.url),
cwd: dirname(fileURLToPath(import.meta.url)),
include: [/src\/*/],
patterns: [
[/^node:.*/], // disallows all node imports
Expand Down
3 changes: 2 additions & 1 deletion playground/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
import { ImpoundPlugin } from 'impound'
import { rollup } from 'rollup'

await rollup({
input: 'src/index.js',
plugins: [
ImpoundPlugin.rollup({
cwd: dirname(import.meta.url),
cwd: dirname(fileURLToPath(import.meta.url)),
include: [/src\/*/],
patterns: [
[/^node:.*/], // disallows all node imports
Expand Down

0 comments on commit 158ff91

Please sign in to comment.