Allow array as value in externals object.

Fixes https://github.com/webpack/webpack/issues/8041.
This commit is contained in:
Ruben Verborgh 2018-09-17 15:19:04 +02:00
parent 2f78aae8d8
commit 3aef0e5844
3 changed files with 18 additions and 0 deletions

View File

@ -123,6 +123,9 @@
{
"type": "object"
},
{
"$ref": "#/definitions/common.arrayOfStringValues"
},
{
"type": "boolean"
}

View File

@ -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");
});

View File

@ -0,0 +1,5 @@
module.exports = {
externals: {
external: ["./math", "subtract"]
}
};