Skip to content

Commit

Permalink
Resolve #1645
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Nov 3, 2017
1 parent 63d9ef6 commit c406f97
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ast/variables/ExternalVariable.js
Expand Up @@ -29,7 +29,7 @@ export default class ExternalVariable extends Variable {
return es ? this.safeName : `${this.module.name}.${this.name}`;
}

includeDeclaration () {
includeVariable () {
if ( this.included ) {
return false;
}
Expand Down
@@ -0,0 +1,13 @@
module.exports = {
description: 'imports from pure external modules that are used should not be omitted',
options: {
external: [ 'warning' ],
pureExternalModules: [ 'warning' ]
},
context: {
require: id => {
if ( id === 'warning' ) return arg => console.log( arg );
throw new Error( 'Unexpected import', id );
}
}
};
@@ -0,0 +1,3 @@
import warning from 'warning';

warning('hi');

0 comments on commit c406f97

Please sign in to comment.