Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1695 from lukastaegert/do-not-exclude-pure-extern…
…al-modules Fix regression when using pureExternalModules flag
- Loading branch information
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/function/samples/keep-used-imports-from-pure-external-modules/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ); | ||
} | ||
} | ||
}; |
3 changes: 3 additions & 0 deletions
3
test/function/samples/keep-used-imports-from-pure-external-modules/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import warning from 'warning'; | ||
|
||
warning('hi'); |
This breaks the case where we import from an external library in one file and import internally with the same import name in another file. Example:
Container.js:
Input.js: