webpack-make-rule
v2.0.0
Published
Webpack helper function for making rules
Downloads
27
Maintainers
Readme
Webpack Make Rule 👑
Intended to support your basic use cases.
A simple little helper function for building rule config objects in Webpack 2.
Installation
$ npm install --save-dev webpack-make-rule
Usage
In file webpack.config.babel.js
import makeRule from 'webpack-make-rule'
/* Having installed all of:
* - json-loader
* - babel-loader
* - web3-loader
* - solc-loader
* - standard-loader
*/
export default {
entry: './src/index.js',
output: {
path: './dist',
filename: 'index.js'
},
module: {
rules: [
makeRule('json'),
makeRule(/\.jsx?$/, 'babel-loader'),
makeRule(/\.sol$/, ['web3', 'solc']),
makeRule(/\.jsx?$/, {'loader': 'standard-loader'}, {'snazzy': true}, 'pre')
]
}
}
Documentation
makeRule
Returns a Webpack rule configuration object
Parameters