case-sensitive-paths-webpack-plugin
case-sensitive-paths-webpack-plugin copied to clipboard
Use promises when listing directories
As discussed in #46, this is the PR to migrate the usage of callbacks over to Promises.
Few things:
- The PR is based of #48 so that should go in first. I'll rebase after.
- I was trying to have
getFilenamesInDir
function set the filenames in the Map, but due to the code organization it's not possible without significant restructure. TheuseBeforeEmitHook
also is an issue because it provides no info whether the supplied file dependency is a file or a folder. - I moved
this.fsOperations += 1;
to increment only if an actual system call is made. The previous code seemed misleading. Take this into consideration when comparing master to this branch. - Instead of returning the file name from
fileExistsWithCase
, maybe it should throw an error which would be caught in thecheckFile
function? - This function may be faster to use but it's only available in Node 10+.
- Webpack API may have support for promises, maybe look into that.
Hi! Are there updates for this PR?