Sort files

When we have `foo.js` and `bar-foo.js`, sometime `foo.<hash>.js` was replacing `bar-foo.js`. This PR sorts the files list by their lengths (descending) to fix that.