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

Sourcemap (.map) files get revisioned with different hash #238

Open
stsvilik opened this issue Jan 10, 2018 · 3 comments
Open

Sourcemap (.map) files get revisioned with different hash #238

stsvilik opened this issue Jan 10, 2018 · 3 comments

Comments

@stsvilik
Copy link

Description

After running gulp-rev on a directory which contains javascript files with associated .map files, revisioned files assign different hash to .map files thus disconnecting them from the associated source files.

Ex. app.js + app.js.map -> rev -> app-87c01c72f1.js + app-f385539b69.js.map

Steps to reproduce

Run gulp rev on a directory which contains source + map files.

@stsvilik
Copy link
Author

Looking at the code I see that you attempt to extract source file from source map, which in most cases would be relative where pathMap hash uses absolute paths. This causes a mismatch of .map to its related source.

@stsvilik
Copy link
Author

There are two more discrepancies that would prevent source maps from working:

  1. Source Map file still points to original non-hashed file name
  2. Source File is not pointing to hashed .map file.

@XhmikosR
Copy link
Contributor

Are you sure the line endings are consistent in the JS files?

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

No branches or pull requests

2 participants