cleanup-loader

1.0.0 • Public • Published

cleanup-loader

licence tag

Prevent webpack from emitting unwanted .js/.js.map files from certain files

cleanup-loader

Installation

$ npm i --save-dev cleanup-loader

Usage

module.exports = {
  module : {
    rules:[
    // Useage with text-extract plugin
    {
      test: /\.scss$/,
      use: ExctractSass.extract({
        use: [
        // ... after all style loaders
        {
          loader: 'cleanup-loader',
          options: {
            test: /\.s?css$/
          }
        }]
      })
    },{
    // Useage with image optimization
      test: /\.(jpe?g|png|gif|svg|eot|ttf|woff2?)$/,
      use: [
      // ... after all your image loaders
      {
        loader: 'cleanup-loader',
        options: {
          test: /\.(jpe?g|png|gif|svg|eot|ttf|woff2?)$/
        }
      }]
    }]
  }
}

Options

Parameter Type Description
test regex generated .js/.js.map files from tested files are prevented from emitting

License

MIT

Credits

@iantsch - web developer behind this and other projects.

Package Sidebar

Install

npm i cleanup-loader

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

7.83 kB

Total Files

5

Last publish

Collaborators

  • iantsch