Update Webpack Dev Server 4.0.0-beta.2
In order to better promote the adaptation of Webpack 5 and the improvement of business, the following will be described according to some improvements after the webpack ecological update is connected to EMP
- After the new version is added
open
More choices - delete
useLocalIp
This product has been used from start to finishlocal-ip
To make it easier to open local IPmodule federation
Lower collaborative developmentFinally, you don't have to write IP to emp-config
watchFiles
Facilitates debugging of non-JS JSON file updates- More below, detailed code access
⚠ product CHANGES
- Removed for node.js API
openPage
Options and--open-page
CLI option to{open: ['/ my-page', '/ my-other-page /']}
To replace. and--open-target [URL]
(no[URL]
The development server will usehost
Option values open browser) and--open-app <browser>
for CLI - Delete the
useLocalIp
Option to support{host: 'the local IP -'}
, the following values can also be provided:local-ipv4
Used for IPv4,local-ipv6
Used for IPv6. stdin
Option has been removed--watch-options-stdin
support- In order to support
client.needClientEntry
andclient.needHotEntry
And delete theinjectClient
andinjectHot
.
Features
- added
watchFiles
Option, now you can reload the server when a file changes, for example{watchFiles: ['/SRC / * * *. PHP ', 'public / / * * *]}
(# 3136) (d73213a) - Added more CLI options, please run
webpack server --help
(# 3148) (03a2b27) - Default startup overlay (#3108) (5e05e48)
- You can specify multiple targets and browsers for the open option, i.e
{ open: { target: ['/my-page', '/my-other-page'], app: ['google-chrome', '--incognito'] } }
(e3c2683)
Bug Fixes
-
/webpack-dev-server url display file list (#3101) (b3374c3)
-
Development server client compatible with IE11/IE10/IE9 (#3129)
- for
IE11
/IE10
You need polyfillThe fetch ()
andPromise
, such as:
module.exports = { entry: { entry: [ 'whatwg-fetch'.'core-js/features/promise'.'./entry.js'],}};Copy the code
- for
IE9
You need polyfillThe fetch ()
andPromise
And usesockjs
Communicate (because not supportedWebSocket
), for example:
module.exports = { entry: { entry: [ 'whatwg-fetch'.'core-js/features/promise'.'./entry.js'],},devServer: { transportMode: 'sockjs',}};Copy the code
Internet explorer does not support
- for
-
Hostname resolution (#3128) (cd39491)
-
Improved CLI options (#3151) (09FA827)
-
Description of invalid option output (#3154) (2e02978)
-
prefer to open the
host
option (#3115) (7e525eb) -
Reduce the number of dependencies