The test property is according to the webpack documentation a condition that "may be a RegExp, a string containing the absolute path, a function(absPath): bool, or an array of one of these combined with 'and'.". require.resolve, on the other hand, returns a module id that is either a number or a string, depending on the environment.
The example configuration file for using the imports loader is wrong:
The test property is according to the webpack documentation a condition that "may be a RegExp, a string containing the absolute path, a function(absPath): bool, or an array of one of these combined with 'and'.".
require.resolve
, on the other hand, returns a module id that is either a number or a string, depending on the environment.