Babel plugin that removes webpack-specific functions (require.ensure, require.include) from JavaScript code, useful for running universal JavaScript on the server without shims. Version 1.1.0 is the latest and only stable release, with low maintenance cadence (last update years ago). Unlike manual polyfills, this plugin automatically strips webpack code at the AST level, enabling server-side execution without code splitting. For Node.js environments with babel-register, it avoids defining dummy functions per file. Not for use in webpack builds, as it would disable code splitting.
npm install babel-plugin-remove-webpackVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install, configure, and use the plugin with babel-register or programmatically.
Only apply in server-side Babel transforms, not in webpack configuration.
Use dynamic import() on modern webpack and consider a different plugin for that case.
Use require() in Babel config or transform.
Run 'npm install babel-plugin-remove-webpack --save-dev' and ensure node_modules is accessible.
Check Babel config includes 'remove-webpack' in plugins, and that the transform runs before execution.