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

Use hash for temporary files #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Use hash for temporary files #43

wants to merge 2 commits into from

Conversation

cprodescu
Copy link

Hash temporary file names.

Current encoding transforms the file path from where the Globalize calls
were extracted into a file name. In deeply nested projects, this can
double the length of the path, causing E_NAMETOOLONG issues.

Before this:
/long/path/to/project/.tmp-globalize-webpack/-long-path-to-project-src-component-foo-index.js
After this:
/long/path/to/project/.tmp-globalize-webpack/5b4c40dd44a2cfde54a3e04cd183aa70edd64c1a.js

This has the downside that it makes the content of the files more opaque, being
harder to debug which content maps to which file. One would have to

echo -n `readlink -f src/component/foo/index.js` | shasum

Fixes #42 and #16.

Corneliu C. Prodescu added 2 commits March 18, 2017 15:37
Current encoding transforms the file path from where the Globalize calls
were extracted into a file name. In deeply nested projects, this can
double the length of the path, causing E_NAMETOOLONG issues.

Before this:
/long/path/to/project/.tmp-globalize-webpack/-long-path-to-project-src-component-foo-index.js
After this:
/long/path/to/project/.tmp-globalize-webpack/5b4c40dd44a2cfde54a3e04cd183aa70edd64c1a.js

This has the downside that it makes the content of the files more opaque, being
harder to debug which content maps to which file. One would have to
```
echo -n `readlink -f src/component/foo/index.js` | shasum
```

This fixes #42 and #16.
@rxaviers
Copy link
Owner

@cprodescu thank you for your PR... I am wondering what we could do to allow this to be done on user land? I mean, I'm wondering if we could expose a plugin option that takes a function, that in turn takes one argument: the filename; and return the processed filename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants