- 🐣 adds support for webpack config resolve support (a.o.
alias
andmodules
)- on the command line with
--webpack-config
- in the
.dependency-cruiser.json
in awebpackConfig
key - in the API as a
pResolveOptions
parameter
- on the command line with
- 🔧 updates several dependencies and development dependencies to latest
- 🔧 removed some files from the npm distribution that weren't necessary on runtime
- 🔧 some internal refactoring to help readability
Webpack config resolve support
Scope
See the FAQ
command line
When you add --webpack-config
as a command line option dependency-cruiser will attempt to read the webpack config file passed as argument (or webpack.config.js
in the current working directory if none was passed) and read any resolve
configuration from it.
The latest fashion in webpack configs is to have it return a function that takes up two two parameters (env
and arguments
). If you need those, you can specify them in .dependency-cruiser.json
in .dependency-cruiser.json
In the options section you can put a webpackConfig
section that allows for specifying (1) the config file name (2) any environment parameters (3) any other (webpack) command line arguments that might be of interest (all optional). E.g.
...
"options": {
"webpackConfig": {
"fileName": "webpack.config.js",
"env": { "production": true },
"arguments": { "mode": "production" }
}
}
...
or
...
"options": {
"webpackConfig": {
"fileName": "webpack.config.js",
"env": "production",
"arguments": { "mode": "production" }
}
}
...
in the API
The cruise
API grew an extra pResolveOptions
parameter that takes a webpack enhanced-resolve resolve key,
Some notes on use
- If you normally use environment variables to run webpack (e.g. NODE_ENV=production webpack) you probably should on dependency-cruiser as well if that makes a difference in the resolve section of your config.
- if you normally pass options and parameters to webpack, you probably should pass these on dependendency-cruiser as well - again if that makes a difference on how the
resolve
key looks. At the moment it's only possible to pass them in the .dependency-cruiser.json- If you normally pass things like
--env.prod
or--env prod
you'll have to translate as specified in (see environment-options) and put it in .dependency-cruiser.json's webpackConfig section (example below) - If you have other parameters that might influence how the
resolve
key looks, you'll have to pass them in the same manner.
- If you normally pass things like