In webpack.config.js to determine module we can use 3 different attributes:
...
module:{
rules: [
{
test: ... // the first one, commonly used in most example we can found on internet
include: ... // the second one
resource: ... // the third one
use: ['style-loader','css-loader'],
},
...
],
...
}
Docs are not explanatory about them:
Rule.test
Include all modules that pass test assertion. If you supply aRule.testoption, you cannot also supply aRule.resource. SeeRule.resourceandCondition.testfor details.
Rule.include
Include all modules matching any of these conditions. If you supply aRule.includeoption, you cannot also supply aRule.resource. SeeRule.resourceandCondition.includefor details.
Rule.resource
AConditionmatched with the resource. See details inRuleconditions.
Each of them are Condition type. Some of them are mutually exclusive. But what is the purpose of each? When we should use each?
If there will be only test everything would be clear.