diff --git a/.changeset/orange-brooms-admire.md b/.changeset/orange-brooms-admire.md new file mode 100644 index 00000000000..075864c9ecf --- /dev/null +++ b/.changeset/orange-brooms-admire.md @@ -0,0 +1,5 @@ +--- +"create-webpack-app": patch +--- + +Use default logic to determine the host for webpack-dev-server. diff --git a/packages/create-webpack-app/templates/init/default/webpack.config.js.tpl b/packages/create-webpack-app/templates/init/default/webpack.config.js.tpl index 9a08a008cde..e9620d86333 100644 --- a/packages/create-webpack-app/templates/init/default/webpack.config.js.tpl +++ b/packages/create-webpack-app/templates/init/default/webpack.config.js.tpl @@ -27,7 +27,6 @@ const config = { },<% if (devServer) { %> devServer: { open: true, - host: "localhost", },<% } %> plugins: [<% if (htmlWebpackPlugin) { %> new HtmlWebpackPlugin({ diff --git a/packages/create-webpack-app/templates/init/react/webpack.config.js.tpl b/packages/create-webpack-app/templates/init/react/webpack.config.js.tpl index 512f4dc6b0a..cf6ce755bf9 100644 --- a/packages/create-webpack-app/templates/init/react/webpack.config.js.tpl +++ b/packages/create-webpack-app/templates/init/react/webpack.config.js.tpl @@ -27,7 +27,6 @@ const config = { },<% if (devServer) { %> devServer: { open: true, - host: "localhost", },<% } %> plugins: [<% if (htmlWebpackPlugin) { %> new HtmlWebpackPlugin({ diff --git a/packages/create-webpack-app/templates/init/svelte/webpack.config.js.tpl b/packages/create-webpack-app/templates/init/svelte/webpack.config.js.tpl index ef0fc202556..86bd7bdecbe 100644 --- a/packages/create-webpack-app/templates/init/svelte/webpack.config.js.tpl +++ b/packages/create-webpack-app/templates/init/svelte/webpack.config.js.tpl @@ -27,7 +27,6 @@ const config = { },<% if (devServer) { %> devServer: { open: true, - host: "localhost", },<% } %> plugins: [<% if (htmlWebpackPlugin) { %> new HtmlWebpackPlugin({ diff --git a/packages/create-webpack-app/templates/init/vue/webpack.config.js.tpl b/packages/create-webpack-app/templates/init/vue/webpack.config.js.tpl index 0d954a2ff67..d4cdf176634 100644 --- a/packages/create-webpack-app/templates/init/vue/webpack.config.js.tpl +++ b/packages/create-webpack-app/templates/init/vue/webpack.config.js.tpl @@ -28,7 +28,6 @@ const config = { },<% if (devServer) { %> devServer: { open: true, - host: "localhost", },<% } %> plugins: [ new VueLoaderPlugin(),<% if (htmlWebpackPlugin) { %> diff --git a/test/create-webpack-app/init/__snapshots__/init.test.js.snap.webpack5 b/test/create-webpack-app/init/__snapshots__/init.test.js.snap.webpack5 index b4073ebfa32..e931c415a9a 100644 --- a/test/create-webpack-app/init/__snapshots__/init.test.js.snap.webpack5 +++ b/test/create-webpack-app/init/__snapshots__/init.test.js.snap.webpack5 @@ -85,7 +85,6 @@ const config = { }, devServer: { open: true, - host: "localhost", }, plugins: [ // Add your plugins here @@ -393,7 +392,6 @@ const config = { }, devServer: { open: true, - host: "localhost", }, plugins: [ new HtmlWebpackPlugin({ @@ -480,7 +478,6 @@ const config = { }, devServer: { open: true, - host: "localhost", }, plugins: [ new HtmlWebpackPlugin({ @@ -565,7 +562,6 @@ const config = { }, devServer: { open: true, - host: "localhost", }, plugins: [ new HtmlWebpackPlugin({ @@ -652,7 +648,6 @@ const config = { }, devServer: { open: true, - host: "localhost", }, plugins: [ new HtmlWebpackPlugin({ @@ -739,7 +734,6 @@ const config = { }, devServer: { open: true, - host: "localhost", }, plugins: [ new HtmlWebpackPlugin({ @@ -890,7 +884,6 @@ const config = { }, devServer: { open: true, - host: "localhost", }, plugins: [ new HtmlWebpackPlugin({ @@ -1009,7 +1002,6 @@ const config = { }, devServer: { open: true, - host: "localhost", }, plugins: [ new HtmlWebpackPlugin({ @@ -1220,7 +1212,6 @@ const config = { }, devServer: { open: true, - host: "localhost", }, plugins: [ new VueLoaderPlugin(),