-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add patch for dep-graph and add library path support
- Loading branch information
1 parent
aa09b04
commit 28b3ae5
Showing
8 changed files
with
96 additions
and
4 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
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
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,29 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
/** | ||
* Patch dep-graph builder function to support Vue files. | ||
* @see https://github.com/nrwl/nx/issues/2960 | ||
*/ | ||
function patchNxDepGraph() { | ||
const filePath = path.join( | ||
process.env.INIT_CWD, | ||
'node_modules/@nrwl/workspace/src/core/project-graph/build-dependencies/typescript-import-locator.js' | ||
); | ||
try { | ||
const fileContent = fs.readFileSync(filePath).toString('utf-8'); | ||
const replacement = "extension !== '.ts' && extension !== '.vue'"; | ||
if (fileContent.includes(replacement)) { | ||
return; | ||
} | ||
fs.writeFileSync( | ||
filePath, | ||
fileContent.replace("extension !== '.ts'", replacement) | ||
); | ||
console.log('Successfully patched Nx dep-graph for Vue support.'); | ||
} catch (err) { | ||
console.error('Failed to patch Nx dep-graph for Vue support.', err); | ||
} | ||
} | ||
|
||
patchNxDepGraph(); |
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