A webpack loader that returns an empty module, useful for silencing unwanted imports (e.g., polyfills) in your bundle. Current stable version is 4.0.1 (released 2020-10-09), supporting webpack 4 and 5. Maintained under the webpack-contrib organization. Unlike other loaders, it provides a minimal no-op module instead of stripping imports entirely.
npm install null-loaderVerified import paths — ran on the pinned version, not inferred.
Basic webpack configuration to replace a polyfill module with an empty module using null-loader.
Upgrade webpack to 4+ and remove any use of `emitFile` option.
Remove the 'emitFile' option from the loader configuration.
Always scope null-loader to specific files using `test` or `include` in the rule.
Ensure the module being nullified has no side effects required by your application.
Run `npm install null-loader --save-dev` and ensure node_modules path is correct.
Remove the unknown option or upgrade null-loader to latest version.
Upgrade to webpack 4+ or use null-loader@3 for webpack 3.