I'd like the same functionality like RequireJS empty:
http://requirejs.org/docs/optimization.html#empty
My use-case is that I include jquery-migrate
in development, but I'd like to exclude this when built for production.
Using IgnorePlugin
just makes it not included, and when require
ing it in the code, it then throws an error (Uncaught Error: Cannot find module jquery-migrate
).
What I'd like to happen is for it to just return undefined, or something of the like (like empty:
in RequireJS). Id like to not touch the import in the code, just configuring it to return undefined
.
EDIT: Using NormalModuleReplacementPlugin
works, if I point the replacement to an empty file. But keeping an empty file around just for this seems unnecessary.