Browse Source

Wrap source id with quotes in unresolved error

semi-dynamic-namespace-imports
Bogdan Chadkin 8 years ago
parent
commit
b215060634
  1. 2
      src/Bundle.js
  2. 2
      test/function/throws-not-found-module/_config.js

2
src/Bundle.js

@ -241,7 +241,7 @@ export default class Bundle {
let isExternal = this.isExternal( externalId );
if ( !resolvedId && !isExternal ) {
if ( isRelative( source ) ) throw new Error( `Could not resolve ${source} from ${module.id}` );
if ( isRelative( source ) ) throw new Error( `Could not resolve '${source}' from ${module.id}` );
this.onwarn( `Treating '${source}' as external dependency` );
isExternal = true;

2
test/function/throws-not-found-module/_config.js

@ -5,6 +5,6 @@ module.exports = {
solo: true,
description: 'throws error if module is not found',
error: function ( err ) {
assert.equal( err.message, 'Could not resolve ./mod from ' + path.resolve( __dirname, 'main.js' ) );
assert.equal( err.message, 'Could not resolve \'./mod\' from ' + path.resolve( __dirname, 'main.js' ) );
}
};
Loading…
Cancel
Save