Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also recover from plugin errors during the initial build (#3219)
- Loading branch information
1 parent
68fbefc
commit 1a63383
Showing
19 changed files
with
99 additions
and
23 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
5 changes: 4 additions & 1 deletion
5
test/function/samples/dynamic-import-relative-not-found/_config.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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
description: 'throws if a dynamic relative import is not found', | ||
error: { | ||
code: 'UNRESOLVED_IMPORT', | ||
message: `Could not resolve './mod' from main.js` | ||
message: `Could not resolve './mod' from main.js`, | ||
watchFiles: [path.resolve(__dirname, 'main.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
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 |
---|---|---|
@@ -1,22 +1,24 @@ | ||
const path = require('path'); | ||
|
||
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; | ||
resolveId(id, parent) { | ||
if (id === 'dep') return id; | ||
}, | ||
load (id) { | ||
if (id === 'dep') | ||
return `import 'dep'`; | ||
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." | ||
code: 'INVALID_EXTERNAL_ID', | ||
message: | ||
"'dep' is imported as an external by dep, but is already an existing non-external module id.", | ||
watchFiles: [path.resolve(__dirname, 'main.js'), 'dep'] | ||
} | ||
}; |
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
description: 'missing relative imports are an error, not a warning', | ||
error: { | ||
code: 'UNRESOLVED_IMPORT', | ||
message: `Could not resolve './missing.js' from main.js` | ||
message: `Could not resolve './missing.js' from main.js`, | ||
watchFiles: [path.resolve(__dirname, 'main.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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
description: 'insists on correct casing for imports', | ||
error: { | ||
code: 'UNRESOLVED_IMPORT', | ||
message: `Could not resolve './foo.js' from main.js` | ||
message: `Could not resolve './foo.js' from main.js`, | ||
watchFiles: [path.resolve(__dirname, 'main.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
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
description: 'throws error if module is not found', | ||
error: { | ||
code: 'UNRESOLVED_IMPORT', | ||
message: `Could not resolve './mod' from main.js` | ||
message: `Could not resolve './mod' from main.js`, | ||
watchFiles: [path.resolve(__dirname, 'main.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