I have an import something like this:
import { foo } from \'bar\';
Is there a way to get Webpack to throw an error if foo
is not d
As Tobias K pointed out in the comments, the other answer is incorrect. Configuring strictModuleExceptionHandling: true
will not produce a compile time error if you try to import a module which does not exist.
The correct configuration is strictExportPresence: true
, which is only available in webpack v2.3.0 and later. (Earlier versions can only show a warning, not an error.)