WebpackConfigHelpers
Parameters
cwd
Webpack module used to create config.
Returns object
Returns wrapper around all loaders from config.
Parameters
config
object webpack config.
Returns Array<LoaderWrapper>
Returns wrapper around all rules from config.
Parameters
config
object webpack config.
Returns Array<RuleWrapper>
Returns wrapper around all plugins from config.
Parameters
config
object webpack config.
Returns Array<PluginWrapper>
Parameters
config
object webpack config.file
string path to test against loader. Resolved relatively to $PWD.
Returns Array<RuleWrapper>
Returns loaders that match provided name.
Parameters
config
object webpack config.name
string name of loader.
Examples
helpers.getLoadersByName(config, 'less-loader')
Returns Array<LoaderWrapper>
Returns plugins that match provided name.
Parameters
config
object webpack config.name
string name of loader.
Examples
helpers.getPluginsByName(config, 'HtmlWebpackPlugin')
Returns Array<PluginWrapper>
Returns plugins that match provided type.
Parameters
config
object webpack config.type
any type of plugin.
Examples
helpers.getPluginsByType(config, webpack.optimize.CommonsChunkPlugin)
Returns Array<PluginWrapper>
Sets template used by HtmlWebpackPlugin.
Parameters
config
object webpack config.template
string template path. See HtmlWebpackPlugin docs.
Wrapper around webpack's plugin.
Type: object
Properties
plugin
object plugin entry.index
number index of plugin in config.
Wrapper around webpack's rule.
Type: object
Properties
rule
object rule entry.index
number index of rule in config.
Wrapper around webpack's loader entry.
Type: object
Properties
rule
object rule entry.ruleIndex
number index of rule in config.loader
object loader entry.loaderIndex
number index of loader in rule.