1.2.0 • Published 5 years ago

filter-webpack-output v1.2.0

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

Filter Webpack Output

This plugin allow you filter Webpack output files based on RegExp. Will be useful if you wan't omit JS files on compilint extracted CSS.

Installation

npm i -D filter-webpack-output

How to use

import FilterWebpackOutput from 'filter-webpack-output';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';

export default {
  entry: 'scss/styles.scss',
  output: {
    path: path.resolve(__dirname, 'dist')
  },
  module: {
    rules: [
      {
        test: /\.scss$/,
        use: [
          MiniCssExtractPlugin.loader,
          'css-loader',
          'sass-loader'
        ]
      }
    ]
  },
  plugins: [
    new MiniCssExtractPlugin({
      filename: "[name].css"
    }),
    new FilterWebpackOutput(/scss[\\\/](.)*\.(js|map)$/) // You can also pass as array of RegExp
  ]
}