-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Replace colons in transform cache filenames #8353
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
Changes from 3 commits
051c575
70067fb
6f47664
0737f6b
57dd825
8b9d171
944291c
af36665
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,6 +94,7 @@ export default class ScriptTransformer { | |
| rootDir: this._config.rootDir, | ||
| }), | ||
| ) | ||
| .update(filename) | ||
| .update(CACHE_VERSION) | ||
| .digest('hex'); | ||
| } else { | ||
|
|
@@ -102,6 +103,7 @@ export default class ScriptTransformer { | |
| .update(fileData) | ||
| .update(configString) | ||
| .update(instrument ? 'instrument' : '') | ||
| .update(filename) | ||
| .update(CACHE_VERSION) | ||
| .digest('hex'); | ||
| } | ||
|
|
@@ -121,11 +123,11 @@ export default class ScriptTransformer { | |
| // Create sub folders based on the cacheKey to avoid creating one | ||
| // directory with many files. | ||
| const cacheDir = path.join(baseCacheDir, cacheKey[0] + cacheKey[1]); | ||
| const cacheFilenamePrefix = path | ||
| .basename(filename, path.extname(filename)) | ||
| .replace(/:/g, '_COLON_'); | ||
|
||
| const cachePath = slash( | ||
| path.join( | ||
| cacheDir, | ||
| path.basename(filename, path.extname(filename)) + '_' + cacheKey, | ||
| ), | ||
| path.join(cacheDir, cacheFilenamePrefix + '_' + cacheKey), | ||
| ); | ||
| createDirectory(cacheDir); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't necessary because
getCacheKeyincludes thefilenamealready.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I thought so as well, my comment was only to seek confirmation ^^