0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

npmのwebpack-devserverでhttpsを有効にする

Posted at

/webpack.config.js

()
const fs = require('fs'); // 追加しておく
()

module.exports = {
  
  ()

  devServer: {
    https: {
      key: fs.readFileSync('./letsencrypt/privkey.pem'),
      cert: fs.readFileSync('./letsencrypt/cert.pem'),
    },

    (他の設定を書く)

  }

補足

  • letsencryptで作った証明書を設定する場合はこんな感じです。
  • なんでこんなの作ったの?とかいうツッコミはなしで。

愚痴

  • ネット検索してるといろんな設定見つかるんで苦労した

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?