Detect circular dependencies in your Next.js app
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(),
}))
)This project uses node and npm.
$ npm install next-circular-dependency
$ # OR
$ yarn add next-circular-dependency- Fork it and create your feature branch: 
git checkout -b my-new-feature - Commit your changes: 
git commit -am "Add some feature" - Push to the branch: 
git push origin my-new-feature - Submit a pull request
 
MIT