This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove absolute paths from file paths
This was breaking determinism because absolute paths could be different on different machines.
- Loading branch information
1 parent
6287d58
commit 668c960
Showing
6 changed files
with
46 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
const relativePathTransform = require('./relative-path-transform'); | ||
|
||
module.exports = function outputFeed(browserify) { | ||
browserify.pipeline.get('deps').push(relativePathTransform()); | ||
}; |
15 changes: 15 additions & 0 deletions
15
lib/browserify-plugins/relative-paths/relative-path-transform.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
const { Transform } = require('readable-stream'); | ||
const { relative } = require('path'); | ||
|
||
module.exports = function idHashTransform() { | ||
return new Transform({ | ||
objectMode: true, | ||
transform(obj, enc, next) { | ||
obj.file = relative(process.cwd(), obj.file); | ||
this.push(obj); | ||
next(); | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters