@@ -77,8 +77,7 @@ export class AngularV12Webpack extends AngularWebpack {
77
77
delete webpackConfig . devServer . watchOptions ;
78
78
79
79
// 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
82
81
delete webpackConfig . devServer . sockPath ;
83
82
84
83
// Removed stats in favor of the stats options from webpack
@@ -90,6 +89,9 @@ export class AngularV12Webpack extends AngularWebpack {
90
89
// Removed watch to avoid "DEP_WEBPACK_WATCH_WITHOUT_CALLBACK" warning
91
90
delete webpackConfig . watch ;
92
91
92
+ // Removed in favor of manual setup entries.
93
+ delete webpackConfig . devServer . injectClient ;
94
+
93
95
// Cleaning up undefined values
94
96
Object . keys ( webpackConfig . devServer ) . forEach ( ( option ) => {
95
97
if ( typeof webpackConfig . devServer [ option ] === 'undefined' ) {
@@ -166,41 +168,6 @@ export class AngularV12Webpack extends AngularWebpack {
166
168
{ }
167
169
) ;
168
170
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
-
204
171
// @ts -ignore
205
172
if ( webpackOptions . hmr ) {
206
173
logger . warn ( tags . stripIndents `NOTICE: Hot Module Replacement (HMR) is enabled for the dev server.
0 commit comments