-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
27 lines (26 loc) · 929 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const CircularDependencyPlugin = require("circular-dependency-plugin");
module.exports = {
resolve: {
fallback: {
fs: false,
},
},
plugins: [
new CircularDependencyPlugin({
// `onStart` is called before the cycle detection starts
onStart({ compilation }) {
console.log("start detecting webpack modules cycles");
},
// `onDetected` is called for each module that is cyclical
onDetected({ module: webpackModuleRecord, paths, compilation }) {
// `paths` will be an Array of the relative module paths that make up the cycle
// `module` will be the module record generated by webpack that caused the cycle
compilation.errors.push(new Error(paths.join(" -> ")));
},
// `onEnd` is called before the cycle detection ends
onEnd({ compilation }) {
console.log("end detecting webpack modules cycles");
},
}),
],
};