-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch @parcel/transformer-vue to use relative paths for id hashes
- Loading branch information
1 parent
eca287d
commit 6275ffb
Showing
2 changed files
with
23 additions
and
0 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,21 @@ | ||
diff --git a/node_modules/@parcel/transformer-vue/lib/VueTransformer.js b/node_modules/@parcel/transformer-vue/lib/VueTransformer.js | ||
index 6e77a66..a6de57a 100644 | ||
--- a/node_modules/@parcel/transformer-vue/lib/VueTransformer.js | ||
+++ b/node_modules/@parcel/transformer-vue/lib/VueTransformer.js | ||
@@ -125,10 +125,15 @@ var _default = new (_plugin().Transformer)({ | ||
}); | ||
} | ||
const descriptor = parsed.descriptor; | ||
+ | ||
+ const path = require('path'); | ||
+ const relativeFilePath = path.relative(process.cwd(), asset.filePath) | ||
+ | ||
let id = (0, _utils().hashObject)({ | ||
- filePath: asset.filePath, | ||
+ filePath: relativeFilePath, | ||
source: options.mode === 'production' ? code : null | ||
}).slice(-6); | ||
+ | ||
return { | ||
type: 'vue', | ||
version: '3.0.0', |