pnpm add webpack-serve-certificate-creator -D
npm install webpack-serve-certificate-creator -D
Import the plugin in your webpack config.
import { WebpackServeCertificateCreator } from 'webpack-serve-certificate-creator';
Add the plugin to your plugins
.
{
plugins: [
new WebpackServeCertificateCreator({
// This dir should be added to .gitignore
outDir: '.certificate-cache',
// Defaults to `localhost`
commonName: 'your.hostname.example.com',
options: {
days: 365,
keySize: 4096,
},
}),
];
}