Skip to content

Instantly share code, notes, and snippets.

@Rafael-Martins
Created July 22, 2019 15:07
Show Gist options
  • Select an option

  • Save Rafael-Martins/5c77f58942225fdb5fac1cac54350b2e to your computer and use it in GitHub Desktop.

Select an option

Save Rafael-Martins/5c77f58942225fdb5fac1cac54350b2e to your computer and use it in GitHub Desktop.
CircularDependencyPlugin config
// webpack.config.js
const CircularDependencyPlugin = require('circular-dependency-plugin')
module.exports = {
entry: "./src/index",
plugins: [
new CircularDependencyPlugin({
// exclude detection of files based on a RegExp
exclude: /a\.js|node_modules/,
// 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(),
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment