https://github.com/tiaanduplessis/next-circular-dependency
Detect circular dependencies in your Next.js app
https://github.com/tiaanduplessis/next-circular-dependency
circular-dependency next nextjs
Last synced: 8 months ago
JSON representation
Detect circular dependencies in your Next.js app
- Host: GitHub
- URL: https://github.com/tiaanduplessis/next-circular-dependency
- Owner: tiaanduplessis
- License: mit
- Created: 2019-10-30T13:54:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-11T14:59:23.000Z (almost 2 years ago)
- Last Synced: 2025-07-26T10:13:56.011Z (11 months ago)
- Topics: circular-dependency, next, nextjs
- Language: JavaScript
- Size: 142 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# next-circular-dependency
[](https://npmjs.org/package/next-circular-dependency)
[](https://npmjs.org/package/next-circular-dependency)
[](https://github.com/RichardLitt/standard-readme)
[](https://npmjs.org/package/next-circular-dependency)
[](http://makeapullrequest.com)
> Detect circular dependencies in your Next.js app
## Table of Contents
- [Usage](#usage)
- [Install](#install)
- [Contribute](#contribute)
- [License](#License)
## Usage
```js
const path = require('path')
const withCSS = require('@zeit/next-css')
const optimizedImages = require('next-optimized-images')
const withNextCircularDeps = require('next-circular-dependency')
require('dotenv').config()
module.exports = withNextCircularDeps(optimizedImages(withCSS({
// exclude detection of files based on a RegExp
exclude: /a\.js|node_modules/,
// include specific files based on a RegExp
include: /dir/,
// add errors to webpack instead of warnings
failOnError: true,
// allow import cycles that include an asyncronous import,
// e.g. via import(/* webpackMode: "weak" */ './file.js')
allowAsyncCycles: false,
// set the current working directory for displaying module paths
cwd: process.cwd(),
}))
)
```
## Install
This project uses [node](https://nodejs.org) and [npm](https://www.npmjs.com).
```sh
$ npm install next-circular-dependency
$ # OR
$ yarn add next-circular-dependency
```
## Contribute
1. Fork it and create your feature branch: `git checkout -b my-new-feature`
2. Commit your changes: `git commit -am "Add some feature"`
3. Push to the branch: `git push origin my-new-feature`
4. Submit a pull request
## License
MIT