-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular/cli): allow node_modules to be linked somewhere else.
Fixes #6499.
- Loading branch information
Showing
4 changed files
with
47 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {ng} from '../../utils/process'; | ||
import {deleteFile, expectFileToExist, moveFile, symlinkFile} from '../../utils/fs'; | ||
|
||
|
||
// THIS TEST REQUIRES TO MOVE NODE_MODULES AND MOVE IT BACK. | ||
export default function() { | ||
return Promise.resolve() | ||
.then(() => moveFile('node_modules', '../node_modules')) | ||
.then(() => symlinkFile('../node_modules', 'node_modules', 'dir')) | ||
.then(() => ng('build')) | ||
.then(() => expectFileToExist('dist/vendor.bundle.js')) | ||
.then(() => expectFileToExist('dist/vendor.bundle.js.map')) | ||
// Cleanup | ||
.then(() => { | ||
return deleteFile('node_modules') | ||
.then(() => moveFile('../node_modules', 'node_modules')); | ||
}, (err: any) => { | ||
return deleteFile('node_modules') | ||
.then(() => moveFile('../node_modules', 'node_modules')) | ||
.then(() => { throw err; }); | ||
}) | ||
} |
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