Skip to content

Commit

Permalink
Use relative ids in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed May 2, 2019
1 parent 76f65ed commit 4ea1620
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/utils/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ export function errNamespaceConflict(
export function errEntryCannotBeExternal(unresolvedId: string) {
return {
code: Errors.UNRESOLVED_ENTRY,
message: `Entry module cannot be external (${unresolvedId}).`
message: `Entry module cannot be external (${relativeId(unresolvedId)}).`
};
}

export function errUnresolvedEntry(unresolvedId: string) {
return {
code: Errors.UNRESOLVED_ENTRY,
message: `Could not resolve entry module (${unresolvedId}).`
message: `Could not resolve entry module (${relativeId(unresolvedId)}).`
};
}

Expand Down
4 changes: 2 additions & 2 deletions test/function/samples/check-resolve-for-entry/_config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
description: 'checks that entry is resolved',
options: {
input: '/not/a/path/that/actually/really/exists'
input: 'not/a/path/that/actually/really/exists'
},
error: {
code: 'UNRESOLVED_ENTRY',
message: 'Could not resolve entry module (/not/a/path/that/actually/really/exists).'
message: 'Could not resolve entry module (not/a/path/that/actually/really/exists).'
}
};
4 changes: 1 addition & 3 deletions test/function/samples/external-entry-point-object/_config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const path = require('path');

module.exports = {
description: 'throws for entry points that are resolved as an external object by plugins',
options: {
Expand All @@ -11,6 +9,6 @@ module.exports = {
},
error: {
code: 'UNRESOLVED_ENTRY',
message: `Entry module cannot be external (${path.resolve(__dirname, 'main.js')}).`
message: `Entry module cannot be external (main.js).`
}
};
4 changes: 1 addition & 3 deletions test/function/samples/external-entry-point/_config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const path = require('path');

module.exports = {
description: 'throws for entry points that are resolved as false by plugins',
options: {
Expand All @@ -11,6 +9,6 @@ module.exports = {
},
error: {
code: 'UNRESOLVED_ENTRY',
message: `Entry module cannot be external (${path.resolve(__dirname, 'main.js')}).`
message: `Entry module cannot be external (main.js).`
}
};

0 comments on commit 4ea1620

Please sign in to comment.