Skip to content

Commit 68f8daa

Browse files
committed
WIP: add in dev time circular dep detection
1 parent f6912b4 commit 68f8daa

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

gulp/tasks/dev.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const config = require('../config');
1919
const webpack = require('webpack');
2020
const merge = require('merge2');
2121
const WebpackDevServer = require('webpack-dev-server');
22+
const CircularDependencyPlugin = require('circular-dependency-plugin');
2223

2324
// Ensure that the test tasks get set up
2425
const testFxns = require('./test');
@@ -64,6 +65,14 @@ function runDevServer(callback) {
6465
resolve: {
6566
extensions: [".tsx", ".ts", ".js"]
6667
},
68+
plugins: [
69+
new CircularDependencyPlugin({
70+
// exclude detection of files based on a RegExp
71+
exclude: /node_modules/,
72+
// add errors to webpack instead of warnings
73+
failOnError: true
74+
})
75+
],
6776
devtool: 'inline-source-map',
6877
};
6978
// Start a webpack-dev-server

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"babel-preset-env": "^1.2.1",
4040
"chai": "^3.5.0",
4141
"child-process-promise": "^2.2.1",
42+
"circular-dependency-plugin": "^3.0.0",
4243
"cz-customizable": "^5.0.0",
4344
"filesize": "^3.5.6",
4445
"git-rev-sync": "^1.9.0",

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,10 @@ cipher-base@^1.0.0, cipher-base@^1.0.1:
13061306
dependencies:
13071307
inherits "^2.0.1"
13081308

1309+
circular-dependency-plugin@^3.0.0:
1310+
version "3.0.0"
1311+
resolved "https://registry.yarnpkg.com/circular-dependency-plugin/-/circular-dependency-plugin-3.0.0.tgz#9b68692e35b0e3510998d0164b6ae5011bea5760"
1312+
13091313
cli-cursor@^1.0.1:
13101314
version "1.0.2"
13111315
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987"

0 commit comments

Comments
 (0)