vite-plugin-basic-ssl
vite-plugin-basic-ssl copied to clipboard
Options
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
}
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
Library authors can't check if https is set when
config?.server.httpsorconfig?.preview.httpsis 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.
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
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.
This is fixed in https://github.com/vitejs/vite-plugin-basic-ssl/pull/16