Skip to content

Commit

Permalink
fix: Add event-source-polyfill for IE(webpack-hot-middleware/client)
Browse files Browse the repository at this point in the history
  • Loading branch information
BUPT-HJM committed Dec 24, 2017
1 parent 58c9eab commit 7218b2d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/build/webpack.client.config.js
Expand Up @@ -53,15 +53,15 @@ let config = merge(base, {
}),
]
})
config.entry['modules/admin'].unshift('webpack-hot-middleware/client?reload=true')
config.entry['modules/front'].unshift('webpack-hot-middleware/client?reload=true')
config.entry['modules/admin'].unshift('event-source-polyfill', 'webpack-hot-middleware/client?reload=true')
config.entry['modules/front'].unshift('event-source-polyfill', 'webpack-hot-middleware/client?reload=true')

if (process.env.NODE_ENV === 'production') {
// 删除devtool
delete config.devtool;
// 删除webpack-hot-middleware
config.entry['modules/admin'].shift();
config.entry['modules/front'].shift();
config.entry['modules/admin'].splice(0, 2);
config.entry['modules/front'].splice(0, 2);
config.output.filename = '[name].[chunkhash:8].min.js';
// 提取css
config.module.rules[0].options.loaders = {
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -55,6 +55,7 @@
"cross-env": "^4.0.0",
"css-loader": "^0.28.0",
"cz-conventional-changelog": "^2.1.0",
"event-source-polyfill": "^0.0.12",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "*",
"html-webpack-plugin": "^2.28.0",
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Expand Up @@ -1757,6 +1757,10 @@ etag@~1.8.0:
version "1.8.0"
resolved "http://r.cnpmjs.org/etag/download/etag-1.8.0.tgz#6f631aef336d6c46362b51764044ce216be3c051"

event-source-polyfill@^0.0.12:
version "0.0.12"
resolved "http://registry.npm.taobao.org/event-source-polyfill/download/event-source-polyfill-0.0.12.tgz#e539cd67fdef2760a16aa5262fa98134df52e3af"

event-stream@~3.3.0:
version "3.3.4"
resolved "http://r.cnpmjs.org/event-stream/download/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571"
Expand Down

0 comments on commit 7218b2d

Please sign in to comment.