Skip to content

Commit d9a5622

Browse files
committed
chore: register EntryDependency to factory
1 parent 3f170bb commit d9a5622

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/utils/DevServerPlugin.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,26 @@ class DevServerPlugin {
252252

253253
// use a hook to add entries if available
254254
if (typeof webpack.EntryPlugin !== 'undefined') {
255+
// Register Entry Dependency in Factory
256+
const EntryDependency = require('webpack/lib/dependencies/EntryDependency');
257+
compiler.hooks.compilation.tap(
258+
'webpack-dev-server',
259+
(compilation, { normalModuleFactory }) => {
260+
compilation.dependencyFactories.set(
261+
EntryDependency,
262+
normalModuleFactory
263+
);
264+
}
265+
);
266+
255267
// eslint-disable-next-line no-undefined
256268
const entryOptions = { name: undefined };
257269
compiler.hooks.make.tapAsync(
258270
'webpack-dev-server',
259271
(compilation, callback) => {
260272
let entriesCompleted = 0;
261273
const errors = [];
274+
// Register additionalEntries
262275
for (const additionalEntry of additionalEntries) {
263276
const dependency = webpack.EntryPlugin.createDependency(
264277
additionalEntry,

0 commit comments

Comments
 (0)