@@ -77,8 +77,7 @@ export class AngularV12Webpack extends AngularWebpack {
7777 delete webpackConfig . devServer . watchOptions ;
7878
7979 // Moved sockPath to client.webSocketURL.pathname option
80- webpackConfig . devServer . client . webSocketURL = webpackConfig . devServer . client . webSocketURL || { } ;
81- webpackConfig . devServer . client . webSocketURL . pathname = webpackConfig . devServer . sockPath ;
80+ // We let webpack handle that now
8281 delete webpackConfig . devServer . sockPath ;
8382
8483 // Removed stats in favor of the stats options from webpack
@@ -90,6 +89,9 @@ export class AngularV12Webpack extends AngularWebpack {
9089 // Removed watch to avoid "DEP_WEBPACK_WATCH_WITHOUT_CALLBACK" warning
9190 delete webpackConfig . watch ;
9291
92+ // Removed in favor of manual setup entries.
93+ delete webpackConfig . devServer . injectClient ;
94+
9395 // Cleaning up undefined values
9496 Object . keys ( webpackConfig . devServer ) . forEach ( ( option ) => {
9597 if ( typeof webpackConfig . devServer [ option ] === 'undefined' ) {
@@ -166,41 +168,6 @@ export class AngularV12Webpack extends AngularWebpack {
166168 { }
167169 ) ;
168170
169- // @ts -ignore
170- if ( webpackOptions . liveReload && ! webpackOptions . hmr ) {
171- // This is needed because we cannot use the inline option directly in the config
172- // because of the SuppressExtractedTextChunksWebpackPlugin
173- // Consider not using SuppressExtractedTextChunksWebpackPlugin when liveReload is enable.
174- // tslint:disable-next-line: no-any
175- addDevServerEntrypoints ( webpackConfig as any , {
176- ...( webpackConfig as any ) . devServer ,
177- inline : true ,
178- } ) ;
179-
180- // Remove live-reload code from all entrypoints but not main.
181- // Otherwise, this will break SuppressExtractedTextChunksWebpackPlugin because
182- // 'addDevServerEntrypoints' adds additional entry-points to all entries.
183- if (
184- webpackConfig . entry &&
185- typeof webpackConfig . entry === 'object' &&
186- ! Array . isArray ( webpackConfig . entry ) &&
187- webpackConfig . entry . main
188- ) {
189- for ( const [ key , value ] of Object . entries ( webpackConfig . entry ) ) {
190- if ( key === 'main' || ! Array . isArray ( value ) ) {
191- // eslint-disable-next-line no-continue
192- continue ;
193- }
194-
195- const webpackClientScriptIndex = value . findIndex ( ( x ) => x . includes ( 'webpack-dev-server/client/index.js' ) ) ;
196- if ( webpackClientScriptIndex >= 0 ) {
197- // Remove the webpack-dev-server/client script from array.
198- value . splice ( webpackClientScriptIndex , 1 ) ;
199- }
200- }
201- }
202- }
203-
204171 // @ts -ignore
205172 if ( webpackOptions . hmr ) {
206173 logger . warn ( tags . stripIndents `NOTICE: Hot Module Replacement (HMR) is enabled for the dev server.
0 commit comments