Skip to content

Latest commit

 

History

History
163 lines (96 loc) · 6.68 KB

webpack-helpers.md

File metadata and controls

163 lines (96 loc) · 6.68 KB

Table of Contents

WebpackConfigHelpers

WebpackConfigHelpers

Parameters

  • cwd

webpack

Webpack module used to create config.

Returns object

getLoaders

Returns wrapper around all loaders from config.

Parameters

Returns Array<LoaderWrapper>

getRules

Returns wrapper around all rules from config.

Parameters

Returns Array<RuleWrapper>

getPlugins

Returns wrapper around all plugins from config.

Parameters

Returns Array<PluginWrapper>

getRulesByMatchingFile

Parameters

Returns Array<RuleWrapper>

getLoadersByName

Returns loaders that match provided name.

Parameters

Examples

helpers.getLoadersByName(config, 'less-loader')

Returns Array<LoaderWrapper>

getPluginsByName

Returns plugins that match provided name.

Parameters

Examples

helpers.getPluginsByName(config, 'HtmlWebpackPlugin')

Returns Array<PluginWrapper>

getPluginsByType

Returns plugins that match provided type.

Parameters

Examples

helpers.getPluginsByType(config, webpack.optimize.CommonsChunkPlugin)

Returns Array<PluginWrapper>

setHtmlTemplate

Sets template used by HtmlWebpackPlugin.

Parameters

PluginWrapper

Wrapper around webpack's plugin.

Type: object

Properties

RuleWrapper

Wrapper around webpack's rule.

Type: object

Properties

LoaderWrapper

Wrapper around webpack's loader entry.

Type: object

Properties