简体   繁体   中英

Serving https in aurelia typescript webpack dev setup

I need to use https://localhost:8080 for testing facebook login in development when I run au run so that the app uses https instead of http.

The current setup is using the standard aurelia+typescript+webpack skeleton created from au new .

I added https: true to devServer field in my webpack.config.js but it doesn't work. https://webpack.js.org/configuration/dev-server/#devserver-https . Do I need to do anything special for Aurelia?

Seems like an oversight in the run.ts task. The https property is not being copied over.

If you make this modification it should work:

function runWebpack(done) {
  // https://webpack.github.io/docs/webpack-dev-server.html
  let opts = {
    host: 'localhost',
    publicPath: config.output.publicPath,
    filename: config.output.filename,
    hot: project.platform.hmr || CLIOptions.hasFlag('hmr'),
    port: project.platform.port,
    contentBase: config.output.path,
    historyApiFallback: true,
    open: project.platform.open,
    stats: {
      colors: require('supports-color')
    },
    https: config.devServer.https // add this line
  }

I submitted a PR that should fix this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM