Merge pull request #28138 from FranklinWhale/webpack-entryfunc

[@types/webpack] EntryFunc may return Entry or Promise<Entry>
This commit is contained in:
Benjamin Lichtman
2018-08-15 09:09:44 -07:00
committed by GitHub
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ declare namespace webpack {
[name: string]: string | string[];
}
type EntryFunc = () => (string | string[] | Promise<string | string[]>);
type EntryFunc = () => (string | string[] | Entry | Promise<string | string[] | Entry>);
interface DevtoolModuleFilenameTemplateInfo {
identifier: string;
+16
View File
@@ -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
//