Webpack 2: How to exclude all node_modules except for
I think you can use regex, something like
exclude: [
/node_modules\/(?!identicons).*/
]
Another way:
exclude: [
{
test: [
path.resolve(__dirname, './node_modules'),
],
exclude: [
path.resolve(__dirname, './node_modules/MODULE_TO_INCLUDE'),
path.resolve(__dirname, './node_modules/ANOTHER_MODULE_TO_INCLUDE'),
]
}
]
It worked for me.