Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow array as value in externals object.
Fixes #8041.
- Loading branch information
1 parent
2f78aae
commit 3aef0e5
Showing
3 changed files
with
18 additions
and
0 deletions.
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
10 changes: 10 additions & 0 deletions
10
test/configCases/externals/optional-externals-array/index.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,10 @@ | ||
it("should not fail on optional externals", function() { | ||
try { | ||
require("external"); | ||
} catch(e) { | ||
expect(e).toBeInstanceOf(Error); | ||
expect(e.code).toBe("MODULE_NOT_FOUND"); | ||
return; | ||
} | ||
throw new Error("It doesn't fail"); | ||
}); |
5 changes: 5 additions & 0 deletions
5
test/configCases/externals/optional-externals-array/webpack.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,5 @@ | ||
module.exports = { | ||
externals: { | ||
external: ["./math", "subtract"] | ||
} | ||
}; |