0.1.1 • Published 1 year ago

devtools-ignore-webpack-plugin v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

npm node npm

DevTools Ignore Webpack Plugin

A Webpack plugin to ignore-listing code in Chrome devtools. To see how ignore-listing helps your development experience, check out this offical demo. This plugin is based on the plugin implemented in Angular CLI project.

Note: This plugin is only for Webpack 5.

Installation

npm install --save-dev devtools-ignore-webpack-plugin

Usage

First, follow webpack's guide to enable source maps in your project. Please note that the "inline" source map options are not supported yet.

Then, add the plugin to your webpack config:

const DevToolsIgnorePlugin = require('devtools-ignore-webpack-plugin')

module.exports = {
  // ...,
  plugins: [
    new DevToolsIgnorePlugin()
  ]
}

Options

Currently, this plugin only supports one option: shouldIgnorePath. It is a function that checks whether a file should be ignored. The function takes a single argument, which is the path of the file. It should return a boolean value.

new DevToolsIgnorePlugin({
  shouldIgnorePath: function(path) {
    if (path.includes('my-lib')) {
      return false;
    }
    return path.includes("/node_modules/") || path.includes("/webpack/");
  }
})

When not specified, the default function is:

function defaultShouldIgnorePath(path) {
  return path.includes("/node_modules/") || path.includes("/webpack/");
}
0.1.1

1 year ago

0.1.0

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago