How to configure the project generated by vue-cli for https access

because only https supports navigator.mediaDevices.getUserMedia.

these are devServer codes in webpack.dev.confi.js

clientLogLevel: "warning",
historyApiFallback: {
  rewrites: [
    { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, "index.html") },
  ],
},
// https: true,
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
  ? { warnings: false, errors: true }
  : false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
  poll: config.dev.poll,
}


Dec.09,2021

npm run serve-- https or yarn serve-- https

Menu