From 78d9f40cf499277c1da6606c39622695c886be54 Mon Sep 17 00:00:00 2001 From: Franklin Tse Date: Wed, 15 Aug 2018 18:25:56 +0800 Subject: [PATCH 1/3] EntryFunc may return Entry --- types/webpack/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index a228afc242..664439523b 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -117,7 +117,7 @@ declare namespace webpack { [name: string]: string | string[]; } - type EntryFunc = () => (string | string[] | Promise); + type EntryFunc = () => (string | string[] | Entry | Promise); interface DevtoolModuleFilenameTemplateInfo { identifier: string; From 9bd8c2e8840c7fb9a35718f26e57ec7e967f8ec7 Mon Sep 17 00:00:00 2001 From: Franklin Tse Date: Wed, 15 Aug 2018 18:30:19 +0800 Subject: [PATCH 2/3] Add test cases --- types/webpack/webpack-tests.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index 2f75d11b31..d8a36fd6db 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -55,6 +55,14 @@ configuration = { entry: () => ['./demo', './demo2'] }; +configuration = { + entry: () => { + p1: "./page1", + p2: "./page2", + p3: "./page3" + } +}; + configuration = { entry: () => new Promise((resolve) => resolve('./demo')) }; @@ -63,6 +71,14 @@ configuration = { entry: () => new Promise((resolve) => resolve(['./demo', './demo2'])) }; +configuration = { + entry: () => new Promise((resolve) => resolve({ + p1: "./page1", + p2: "./page2", + p3: "./page3" + })) +}; + // // https://webpack.github.io/docs/optimization.html // From b5097f8c646d19d3de2b8d7a4981472ee8c10736 Mon Sep 17 00:00:00 2001 From: Franklin Tse Date: Wed, 15 Aug 2018 21:54:36 +0800 Subject: [PATCH 3/3] Fix test case --- types/webpack/webpack-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index d8a36fd6db..16234d422a 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -56,11 +56,11 @@ configuration = { }; configuration = { - entry: () => { + entry: () => ({ p1: "./page1", p2: "./page2", p3: "./page3" - } + }) }; configuration = {