IgnoreNotFoundExportPlugin
raw JSON → 1.0.2 verified Mon Apr 27 auth: no javascript maintenance
Webpack plugin to suppress 'export not found' or 'ModuleDependencyWarning' warnings, commonly used when re-exporting TypeScript interfaces or other type-only exports that webpack cannot resolve. Current stable version 1.0.2 supports webpack >=4.0.0. The plugin is lightweight, with simple configuration via include/exclude patterns. It is a niche solution for a specific webpack warning noise issue, lacking active maintenance (last release 2020). Key differentiator: it targets a specific warning type, unlike general warning suppression plugins.
Common errors
error TypeError: IgnoreNotFoundExportPlugin is not a constructor ↓
cause Using ES module import syntax or destructuring require incorrectly.
fix
Use
const IgnoreNotFoundExportPlugin = require('ignore-not-found-export-webpack-plugin'); then new IgnoreNotFoundExportPlugin(...). error Warnings are still shown even after adding plugin ↓
cause The include/exclude pattern does not match the warning source.
fix
Check the exact path of the file causing warnings; adjust the regex in
include option. For absolute paths, use a regex like /.\/src\/.*\.ts$/. error Cannot find module 'ignore-not-found-export-webpack-plugin' ↓
cause Package not installed; missing from node_modules.
fix
Run
npm install --save-dev ignore-not-found-export-webpack-plugin. Warnings
gotcha Plugin may suppress useful warnings about missing imports, potentially hiding real issues. ↓
fix Use include option to limit suppression to specific file types (e.g., TypeScript interfaces).
deprecated Package last updated in 2020; using webpack 5 may require alternative approaches. ↓
fix Consider using webpack's built-in 'ignoreWarnings' option (webpack 5) or other custom plugin.
gotcha Does not work with ESM imports; requires CommonJS require for import. ↓
fix Use require() instead of import statement.
Install
npm install ignore-not-found-export-webpack-plugin yarn add ignore-not-found-export-webpack-plugin pnpm add ignore-not-found-export-webpack-plugin Imports
- IgnoreNotFoundExportPlugin wrong
import IgnoreNotFoundExportPlugin from 'ignore-not-found-export-webpack-plugin';correctconst IgnoreNotFoundExportPlugin = require('ignore-not-found-export-webpack-plugin'); - IgnoreNotFoundExportPlugin wrong
module.exports = { plugins: [IgnoreNotFoundExportPlugin({ include: /\.tsx?$/ })] };correctmodule.exports = { plugins: [new IgnoreNotFoundExportPlugin({ include: /\.tsx?$/ })] }; - IgnoreNotFoundExportPlugin wrong
const { IgnoreNotFoundExportPlugin } = require('ignore-not-found-export-webpack-plugin');correctconst IgnoreNotFoundExportPlugin = require('ignore-not-found-export-webpack-plugin');
Quickstart
const IgnoreNotFoundExportPlugin = require('ignore-not-found-export-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: { filename: 'bundle.js' },
plugins: [
new IgnoreNotFoundExportPlugin({
include: [/\.tsx?$/]
})
]
};