1.0.1 • Published 5 years ago

next-circular-dependency v1.0.1

Weekly downloads
890
License
MIT
Repository
github
Last release
5 years ago

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