Registry / testing / wipe-webpack-cache

wipe-webpack-cache

JSON →
library2.1.0jsnpmunverified

Wipes webpack internal module cache in a controlled way for testing and mocking. Version 2.1.0 is stable; low release cadence. Requires NamedModulesPlugin and HotModuleReplacementPlugin in webpack config. Provides a filter-and-bubble approach to selectively clear cache entries. Useful with proxyquire and similar testing libraries.

npm install wipe-webpack-cache
INSTALL
IMPORT
SIG · WIPE-WEBPACK-CACHE
W
wipe-webpack-cache
testingjavascriptv2.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

wipe
import { wipe } from 'wipe-webpack-cache'
const wipe = require('wipe-webpack-cache')
Default export is a function named 'wipe'.
default
import wipe from 'wipe-webpack-cache'
const wipe = require('wipe-webpack-cache').default
Default import is the same as named 'wipe'.
wipeNodeCache
import { wipeNodeCache } from 'wipe-node-cache'
const wipeNodeCache = require('wipe-webpack-cache')
This package is a separate npm package 'wipe-node-cache', not this one.

Shows how to import and use the wipe function to clear module cache for testing.

import { wipe } from 'wipe-webpack-cache'; // Wipe all modules except those in node_modules wipe(null, (fileName) => !fileName.includes('node_modules'));
Debug
Known issues
gotchaRequires NamedModulesPlugin and HotModuleReplacementPlugin in webpack config, or it will not work correctly.
fix
Add new webpack.NamedModulesPlugin() and new webpack.HotModuleReplacementPlugin() to plugins array.
affects: all
Errors
Common errors & fixes
Cannot find module 'wipe-webpack-cache'
Package not installed or import path incorrect.
fix
Run npm install --save-dev wipe-webpack-cache
wipe is not a function
Incorrect import style (e.g., using default export incorrectly).
fix
Use import { wipe } from 'wipe-webpack-cache' or import wipe from 'wipe-webpack-cache'
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
wipe-webpack-cache — npm install wipe-webpack-cache · libregistry