Skip to content

Commit

Permalink
refactor: 🔨 use add-server-client-script-webpack-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
huruji committed Feb 24, 2019
1 parent 5bac211 commit 3651a3a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/plugins/devServer-plugin/index.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
});
};
2 changes: 1 addition & 1 deletion packages/cli/plugins/html-multi-entry-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3651a3a

Please sign in to comment.