Skip to content

Commit

Permalink
Don't process the entry file, it causes explosions
Browse files Browse the repository at this point in the history
See rollup#63 for an explanation of why.
  • Loading branch information
tivac committed May 10, 2016
1 parent 60958c6 commit bc521bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function commonjs ( options = {} ) {

return {
resolveId ( importee, importer ) {
if ( importee[0] !== '.' ) return; // not our problem
if ( importee[0] !== '.' || !importer ) return; // not our problem

const resolved = resolve( dirname( importer ), importee );
const candidates = getCandidates( resolved, extensions );
Expand Down
7 changes: 7 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,11 @@ describe( 'rollup-plugin-commonjs', () => {
assert.equal( global.setImmediate, mod.immediate, generated.code );
});
});

it( 'does not process the entry file when it has a leading "." (issue #63)', () => {
return rollup({
entry: './samples/basic/main.js',
plugins: [ commonjs() ]
}).then( executeBundle );
});
});

0 comments on commit bc521bf

Please sign in to comment.