Coder Social home page Coder Social logo

devtools-ignore-webpack-plugin's Introduction

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/");
}

devtools-ignore-webpack-plugin's People

Contributors

mondaychen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

devtools-ignore-webpack-plugin's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.