webpack-make-rule

2.0.0 • Public • Published

Webpack Make Rule 👑

Intended to support your basic use cases.
A simple little helper function for building rule config objects in Webpack 2.

Build Status Dependency Status devDependency Status

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

Package Sidebar

Install

npm i webpack-make-rule

Weekly Downloads

1

Version

2.0.0

License

MIT

Last publish

Collaborators

  • rongierlach