diff --git a/packages/cli/package.json b/packages/cli/package.json index 2a29420..4945b41 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -16,6 +16,7 @@ "@babel/core": "^7.2.2", "@babel/plugin-transform-react-jsx": "^7.3.0", "@babel/preset-env": "^7.2.3", + "add-server-client-script-webpack-plugin": "^1.0.2", "author-webpack-plugin": "^1.0.1", "autoprefixer": "^9.4.7", "babel-loader": "^8.0.4", diff --git a/packages/cli/plugins/devServer-plugin/index.js b/packages/cli/plugins/devServer-plugin/index.js index c5a7247..5fd9a56 100644 --- a/packages/cli/plugins/devServer-plugin/index.js +++ b/packages/cli/plugins/devServer-plugin/index.js @@ -1,5 +1,6 @@ const { HotModuleReplacementPlugin } = require('webpack'); const OpenBrowserPlugin = require('open-browser-plugin'); +const AddServerClientPlugin = require('add-server-client-script-webpack-plugin'); module.exports.apply = (compiler) => { let isWatch = false; @@ -20,6 +21,7 @@ module.exports.apply = (compiler) => { .watchContentBase(true); config.plugin('openbrowser').use(OpenBrowserPlugin, [`http://localhost:${port}`]); + config.plugin('add server client script').use(AddServerClientPlugin, [`http://localhost:${port}`]); config.plugin('hot').use(HotModuleReplacementPlugin); }); }; diff --git a/packages/cli/plugins/html-multi-entry-plugin/index.js b/packages/cli/plugins/html-multi-entry-plugin/index.js index a479315..2ae8abf 100644 --- a/packages/cli/plugins/html-multi-entry-plugin/index.js +++ b/packages/cli/plugins/html-multi-entry-plugin/index.js @@ -84,7 +84,7 @@ module.exports.apply = (compiler) => { if (isWatch) { config .entry(file) - .add(`${require.resolve('webpack-dev-server/client')}?http://localhost:${port}`) + // .add(`${require.resolve('webpack-dev-server/client')}?http://localhost:${port}`) .add(files[i]) .end(); } else {