0.1.2 • Published 5 years ago

cheerio-webpack-plugin v0.1.2

Weekly downloads
43
License
MIT
Repository
github
Last release
5 years ago

Cheerio Webpack Plugin

Instllation

$ npm install cheerio-webpack-plugin

Usage

const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CheerioWebpackPlugin = require('cheerio-webpack-plugin')

module.exports = {
  entry: './src/index.js',

  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, './dist')
  },

  plugins: [
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: './src/index.html'
    }),
    new CheerioWebpackPlugin({
      test: /.html$/,
      callback: function ($) {
        $('link').remove()
      }
    })
  ]
}

License

The MIT License