Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
devtools-ignore-webpack-plugin
Advanced tools
A Webpack plugin to ignore sourcemap in Chrome devtools
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.
npm install --save-dev devtools-ignore-webpack-plugin
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()],
};
Currently, this plugin supports two options: shouldIgnorePath
and isSourceMapAsset
.
shouldIgnorePath
is a function that checks whether a source 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/");
}
isSourceMapAsset
is a function that checks whether a map file is potentially a source map asset. The function takes a single argument, which is the name of the potential source map asset. It should return a boolean value.
Note: This should rarely be needed. Known scenarios include only looking at .js.map
in rare scenarios where you have other files that end in .map
new DevToolsIgnorePlugin({
isSourceMapAsset: function (name) {
return name.endsWith(".js.map"); // if you have other files that end in .map
},
});
When not specified, the default function is:
function defaultisSourceMapAsset(name) {
return name.endsWith(".map");
}
FAQs
A Webpack plugin to ignore sourcemap in Chrome devtools
The npm package devtools-ignore-webpack-plugin receives a total of 1 weekly downloads. As such, devtools-ignore-webpack-plugin popularity was classified as not popular.
We found that devtools-ignore-webpack-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.