globalize-webpack-plugin icon indicating copy to clipboard operation
globalize-webpack-plugin copied to clipboard

Use hash for temporary files

Open cprodescu opened this issue 7 years ago • 1 comments

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.

cprodescu avatar Mar 26 '17 07:03 cprodescu

@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.

rxaviers avatar May 20 '17 20:05 rxaviers