Skip to content

Commit 70c9f65

Browse files
authored
enhance webpack config for https and port (#36)
* if '--https false' is specified when calling webpack or webpack-dev-server, it will use http instead of https. This will run the dev server using http: npm run dev-server -- --https false This will build without prompting for dev certs: npm run build -- --https false * Get the port from the package.json config "dev-server-port". If the value of this config is changed in package.json, "npm run dev-server" will use it.
1 parent 2810807 commit 70c9f65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

webpack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ module.exports = async (env, options) => {
6262
devServer: {
6363
headers: {
6464
"Access-Control-Allow-Origin": "*"
65-
},
66-
https: await devCerts.getHttpsServerOptions(),
67-
port: 3000
65+
},
66+
https: (options.https !== undefined) ? options.https : await devCerts.getHttpsServerOptions(),
67+
port: process.env.npm_package_config_dev_server_port || 3000
6868
}
6969
};
7070

0 commit comments

Comments
 (0)