Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ import { fileURLToPath } from "node:url";<% if (htmlWebpackPlugin) { %>
import HtmlWebpackPlugin from "html-webpack-plugin";<% } %><% if (extractPlugin !== "No") { %>
import MiniCssExtractPlugin from "mini-css-extract-plugin";<% } %><% if (workboxWebpackPlugin) { %>
import WorkboxWebpackPlugin from "workbox-webpack-plugin";<% } %>
<% const { execFileSync } = await import("node:child_process");
let host;
try {
const family = execFileSync(process.execPath, [
"--input-type=module",
"--eval",
`import dns from "node:dns/promises";
const { family } = await dns.lookup("localhost");
process.stdout.write(String(family));`
], { encoding: "utf8", timeout: 3000 }).trim();
host = family === "6" ? "::1" : "127.0.0.1";
} catch { host = null; } %>

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -27,7 +39,8 @@ const config = {
},<% if (devServer) { %>
devServer: {
open: true,
host: "localhost",
host: "localhost",<% if (host) { %>
allowedHosts: ["<%= host %>"],<% } %>
},<% } %>
plugins: [<% if (htmlWebpackPlugin) { %>
new HtmlWebpackPlugin({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ import { fileURLToPath } from "node:url";<% if (htmlWebpackPlugin) { %>
import HtmlWebpackPlugin from "html-webpack-plugin";<% } %><% if (extractPlugin !== "No") { %>
import MiniCssExtractPlugin from "mini-css-extract-plugin";<% } %><% if (workboxWebpackPlugin) { %>
import WorkboxWebpackPlugin from "workbox-webpack-plugin";<% } %>
<% const { execFileSync } = await import("node:child_process")
let host;
try {
const family = execFileSync(process.execPath, [
"--input-type=module",
"--eval",
`import dns from "node:dns/promises";
const { family } = await dns.lookup("localhost");
process.stdout.write(String(family));`
], { encoding: "utf8", timeout: 3000 }).trim();
host = family === "6" ? "::1" : "127.0.0.1";
} catch { host = null; } %>

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -27,7 +39,8 @@ const config = {
},<% if (devServer) { %>
devServer: {
open: true,
host: "localhost",
host: "localhost",<% if (host) { %>
allowedHosts: ["<%= host %>"],<% } %>
},<% } %>
plugins: [<% if (htmlWebpackPlugin) { %>
new HtmlWebpackPlugin({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ import { fileURLToPath } from "node:url";<% if (htmlWebpackPlugin) { %>
import HtmlWebpackPlugin from "html-webpack-plugin";<% } %><% if (extractPlugin !== "No") { %>
import MiniCssExtractPlugin from "mini-css-extract-plugin";<% } %><% if (workboxWebpackPlugin) { %>
import WorkboxWebpackPlugin from "workbox-webpack-plugin";<% } %>
<% const { execFileSync } = await import("node:child_process")
let host;
try {
const family = execFileSync(process.execPath, [
"--input-type=module",
"--eval",
`import dns from "node:dns/promises";
const { family } = await dns.lookup("localhost");
process.stdout.write(String(family));`
], { encoding: "utf8", timeout: 3000 }).trim();
host = family === "6" ? "::1" : "127.0.0.1";
} catch { host = null; } %>

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -27,7 +39,8 @@ const config = {
},<% if (devServer) { %>
devServer: {
open: true,
host: "localhost",
host: "localhost",<% if (host) { %>
allowedHosts: ["<%= host %>"],<% } %>
},<% } %>
plugins: [<% if (htmlWebpackPlugin) { %>
new HtmlWebpackPlugin({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ import { fileURLToPath } from "node:url";<% if (htmlWebpackPlugin) { %>
import HtmlWebpackPlugin from "html-webpack-plugin";<% } %><% if (extractPlugin !== "No") { %>
import MiniCssExtractPlugin from "mini-css-extract-plugin";<% } %><% if (workboxWebpackPlugin) { %>
import WorkboxWebpackPlugin from "workbox-webpack-plugin";<% } %>
<% const { execFileSync } = await import("node:child_process")
let host;
try {
const family = execFileSync(process.execPath, [
"--input-type=module",
"--eval",
`import dns from "node:dns/promises";
const { family } = await dns.lookup("localhost");
process.stdout.write(String(family));`
], { encoding: "utf8", timeout: 3000 }).trim();
host = family === "6" ? "::1" : "127.0.0.1";
} catch { host = null; } %>

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -28,7 +40,8 @@ const config = {
},<% if (devServer) { %>
devServer: {
open: true,
host: "localhost",
host: "localhost",<% if (host) { %>
allowedHosts: ["<%= host %>"],<% } %>
},<% } %>
plugins: [
new VueLoaderPlugin(),<% if (htmlWebpackPlugin) { %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const config = {
devServer: {
open: true,
host: "localhost",
allowedHosts: ["::1"],
},
plugins: [
// Add your plugins here
Expand Down Expand Up @@ -394,6 +395,7 @@ const config = {
devServer: {
open: true,
host: "localhost",
allowedHosts: ["::1"],
},
plugins: [
new HtmlWebpackPlugin({
Expand Down Expand Up @@ -481,6 +483,7 @@ const config = {
devServer: {
open: true,
host: "localhost",
allowedHosts: ["::1"],
},
plugins: [
new HtmlWebpackPlugin({
Expand Down Expand Up @@ -566,6 +569,7 @@ const config = {
devServer: {
open: true,
host: "localhost",
allowedHosts: ["::1"],
},
plugins: [
new HtmlWebpackPlugin({
Expand Down Expand Up @@ -653,6 +657,7 @@ const config = {
devServer: {
open: true,
host: "localhost",
allowedHosts: ["::1"],
},
plugins: [
new HtmlWebpackPlugin({
Expand Down Expand Up @@ -740,6 +745,7 @@ const config = {
devServer: {
open: true,
host: "localhost",
allowedHosts: ["::1"],
},
plugins: [
new HtmlWebpackPlugin({
Expand Down Expand Up @@ -891,6 +897,7 @@ const config = {
devServer: {
open: true,
host: "localhost",
allowedHosts: ["::1"],
},
plugins: [
new HtmlWebpackPlugin({
Expand Down Expand Up @@ -1010,6 +1017,7 @@ const config = {
devServer: {
open: true,
host: "localhost",
allowedHosts: ["::1"],
},
plugins: [
new HtmlWebpackPlugin({
Expand Down Expand Up @@ -1221,6 +1229,7 @@ const config = {
devServer: {
open: true,
host: "localhost",
allowedHosts: ["::1"],
},
plugins: [
new VueLoaderPlugin(),
Expand Down
Loading