Browse Source

Merge pull request #804 from skeggse/patch-1

Add explicit entry resolve error message
rollup-init
Rich Harris 8 years ago
committed by GitHub
parent
commit
ac5ac9de44
  1. 1
      src/Bundle.js
  2. 11
      test/function/check-resolve-for-entry/_config.js
  3. 1
      test/function/load-returns-string-or-null/main.js

1
src/Bundle.js

@ -89,6 +89,7 @@ export default class Bundle {
// of the entry module's dependencies // of the entry module's dependencies
return this.resolveId( this.entry, undefined ) return this.resolveId( this.entry, undefined )
.then( id => { .then( id => {
if ( id == null ) throw new Error( `Could not resolve entry (${this.entry})` );
this.entryId = id; this.entryId = id;
return this.fetchModule( id, undefined ); return this.fetchModule( id, undefined );
}) })

11
test/function/check-resolve-for-entry/_config.js

@ -0,0 +1,11 @@
var assert = require( 'assert' );
module.exports = {
description: 'checks that entry is resolved',
options: {
entry: '/not/a/path/that/actually/really/exists'
},
error: function ( err ) {
assert.ok( /Could not resolve entry/.test( err.message ) );
}
};

1
test/function/load-returns-string-or-null/main.js

@ -0,0 +1 @@
throw new Error('should not be reached');
Loading…
Cancel
Save