next-circular-dependency
v1.0.1
Published
Detect circular dependencies in your Next.js app
Downloads
8,560
Maintainers
Readme
next-circular-dependency
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
- 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
License
MIT