Skip to content

Commit 17a0e5c

Browse files
committed
FIX: convert env variable PORT to a number.
(close #1099)
1 parent b237c0f commit 17a0e5c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

template/build/webpack.dev.conf.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
88
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
99
const portfinder = require('portfinder')
1010

11+
const HOST = process.env.HOST
12+
const PORT = process.env.PORT && Number(process.env.PORT)
13+
1114
const devWebpackConfig = merge(baseWebpackConfig, {
1215
module: {
1316
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
@@ -21,8 +24,8 @@ const devWebpackConfig = merge(baseWebpackConfig, {
2124
historyApiFallback: true,
2225
hot: true,
2326
compress: true,
24-
host: process.env.HOST || config.dev.host,
25-
port: process.env.PORT || config.dev.port,
27+
host: HOST || config.dev.host,
28+
port: PORT || config.dev.port,
2629
open: config.dev.autoOpenBrowser,
2730
overlay: config.dev.errorOverlay
2831
? { warnings: false, errors: true }

0 commit comments

Comments
 (0)