Skip to content

tiaanduplessis/next-circular-dependency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

next-circular-dependency

package version package downloads standard-readme compliant package license make a pull request

Detect circular dependencies in your Next.js app

Table of Contents

Usage

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 and npm.

$ 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

About

Detect circular dependencies in your Next.js app

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published