shaketbaby / directory-named-webpack-plugin

A Webpack plugin that treats a file with the name of directory as the index file
MIT License
182 stars 17 forks source link

Use `includes` for Windows compatibility #29

Closed DHedgecock closed 6 years ago

DHedgecock commented 6 years ago

Hello,

When using an options.include or options.exclude the module resolution fails in Windows. Calling .search converts the dirPath to a regex, but on Windows the / create an invalid regex. This PR uses includes to check if the dirPath is part of the include or exclude options.

Closes #30