webpack-get-dlls
v4.0.0
Published
Get DLL configs from a webpack config
Downloads
8
Maintainers
Readme
webpack-get-dlls
Get DLL configs from a webpack config
Install
npm install webpack-get-dlls --save
Or, install globally for CLI:
npm install -g webpack-get-dlls
API
getDlls(webpackConfig : Object) : Object
Get all DLL configuration objects referenced in the given webpackConfig
.
- webpackConfig {Object} (required) The webpack configuration
Returns an object with dlls
and errors
properties.
For each DLL that could not be found a record will be in errors
.
Error types are at getDlls.ERRORS
.
Example:
const webpackConfig = require('./webpack.config.js')
const getDlls = require('webpack-get-dlls')
const {dlls, errors} = getDlls(webpackConfig)
if (errors) {
console.log(errors)
//=> [{
// error: 'DLL_NOT_FOUND',
// position: 0, // zero-indexed plugin position
// path: './vendor.webpack.config.js', // only present for DLL_NOT_FOUND
// }]
}
console.log(dlls)
//=> [{
// name: 'dll.webpack.config.js',
// config: ... // the DLL configuration object
// }]
CLI
Outputs the name of each DLL on its own line.
Available as webpack-get-dlls
or wpk-get-dlls
.
Example:
$ webpack-get-dlls ./webpack.config.js
dll1.webpack.config.js
dll2.webpack.config.js
Contributing
All pull requests and issues welcome!
If you're not sure how, check out the great video tutorials on egghead.io!
License
MIT © Sam Gluck