vite-plugin-basic-ssl icon indicating copy to clipboard operation
vite-plugin-basic-ssl copied to clipboard

Options

Open geekact opened this issue 2 years ago • 4 comments
trafficstars

Add options to configure where needs ssl, for example:

ssl({
  server: true,
  preview: true,
});

Or just checking config

const https = { cert: '', key: '' };

if (config?.server.https === true) {
 // assign https
}
if (config?.preview.https === true) {
  // assign https
}

geekact avatar Dec 09 '22 16:12 geekact

Library authors can't check if https is set when config?.server.https or config?.preview.https is not specified right? Why not specify it like?:

export default defineConfig({
  plugins: [basicSsl()],
  server: {
    https: true
  },
  preview: {
    https: true
  }
});

related: https://github.com/microsoft/playwright/pull/19697

sand4rt avatar Dec 25 '22 15:12 sand4rt

Library authors can't check if https is set when config?.server.https or config?.preview.https is not specified right? Would specify it instead like:

export default defineConfig({
  plugins: [basicSsl()],
  server: {
    https: true
  },
  preview: {
    https: true
  }
});

You are providing a new way and it just up to maintainers.

geekact avatar Dec 25 '22 15:12 geekact

Yeah it's up to the maintainers. I'm just sharing some thoughts here :) It's not really a new way or do i miss something?: preview.https type: boolean | https.ServerOptions

sand4rt avatar Dec 28 '22 12:12 sand4rt

Being able to set the proposed options or for the plugin to respect the user defined settings would be beneficial. To address the issue, i created PR #16.

digiinsanity avatar Jan 10 '23 16:01 digiinsanity

This is fixed in https://github.com/vitejs/vite-plugin-basic-ssl/pull/16

bluwy avatar Jan 25 '24 14:01 bluwy