Skip to content

Commit 500283e

Browse files
authored
refactor: remove stale code (#3035)
1 parent 9b6b5c1 commit 500283e

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

test/server/utils/DevServerPlugin.test.js

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,7 @@ const normalize = (entry) => entry.split(path.sep).join('/');
1111

1212
describe('DevServerPlugin util', () => {
1313
async function getEntries(compiler) {
14-
const entryOption = compiler.options.entry;
15-
if (isWebpack5) {
16-
const entries = [];
17-
18-
const compilation = {
19-
addEntry(_context, dep, _options, cb) {
20-
if (!dep.loc.name) {
21-
entries.push(dep.request);
22-
}
23-
cb();
24-
},
25-
};
26-
await Promise.all(
27-
compiler.hooks.make.taps
28-
.filter((tap) => tap.name === 'DevServerPlugin')
29-
.map((tap) => tap.fn(compilation))
30-
);
31-
32-
// normalize entry descriptors
33-
if (typeof entryOption === 'function') {
34-
// merge entries into the dynamic entry function
35-
Object.assign(entryOption, entries);
36-
return entryOption;
37-
} else if (entryOption.main) {
38-
entries.push(...entryOption.main.import);
39-
}
40-
// merge named exports into entries
41-
Object.assign(entries, entryOption);
42-
return entries;
43-
}
44-
return entryOption;
14+
return compiler.options.entry;
4515
}
4616

4717
it('should preserves dynamic entry points', (done) => {

0 commit comments

Comments
 (0)