Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure CLI warnings still show on errors, add an error for externalId…
… collissions (#2334) * ensure CLI warnings display on error, ensure external doesnt collide with existing * throw when an external collides with a non-external * include test for external colissions
- Loading branch information
1 parent
bc5d433
commit 93438e4
Showing
4 changed files
with
39 additions
and
1 deletion.
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,25 @@ | ||
var path = require('path'); | ||
var assert = require('assert'); | ||
|
||
module.exports = { | ||
description: 'external paths from custom resolver remain external (#633)', | ||
options: { | ||
external: (_id, parent) => parent === 'dep', | ||
plugins: [ | ||
{ | ||
resolveId (id, parent) { | ||
if (id === 'dep') | ||
return id; | ||
}, | ||
load (id) { | ||
if (id === 'dep') | ||
return `import 'dep'`; | ||
} | ||
} | ||
] | ||
}, | ||
error: { | ||
code: "INVALID_EXTERNAL_ID", | ||
message: "'dep' is imported as an external by dep, but is already an existing non-external module id." | ||
} | ||
}; |
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 @@ | ||
import 'dep'; |