Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for fileDependencies of SortableSet-type #7

Closed
wants to merge 2 commits into from
Closed

Workaround for fileDependencies of SortableSet-type #7

wants to merge 2 commits into from

Conversation

kapersoft
Copy link

When webpack fileDependencies is of a SortableSet-type the getFilesMtimes-function returns a TypeError: path must be a string or Buffer-error.

With this commit the function getFilesMtimes checks if the file-variable is a string before continuing the file-check.

kapersoft and others added 2 commits July 23, 2018 16:55
When webpack fileDependencies is of a `SortableSet`-type the `getFilesMtimes`-function returns a `TypeError: path must be a string or Buffer`-error.

With this commit the function `getFilesMtimes` checks if the `file`-variable is a string before continuing the file-check.
@@ -4,6 +4,10 @@ var async = require('async');
function getFilesMtimes(files, concurrencyLimit, done) {
var filesMtimes = {};
async.eachLimit(files, concurrencyLimit, function(file, fileDone) {
if (typeof file !== 'string') {
return fileDone();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this breaks a whole logic a this plugin, bacause the dependencies updated times won't be stored in filesMtimes. I would rather convert the Set to an Array in index.js

// collect info about input dependencies to compilation
  compiler.plugin('after-compile', function(compilation, afterCompileDone) {
    // get updated mtimes of file dependencies of compilation
    pluginContext.updateDependenciesMtimes(Array.from(compilation.fileDependencies), afterCompileDone);
  });

vhadianto added a commit to vhadianto/only-if-changed-webpack-plugin that referenced this pull request Feb 17, 2019
@smitty3268 smitty3268 mentioned this pull request Mar 28, 2019
@kapersoft kapersoft closed this by deleting the head repository Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants