pearofducks / rollup-plugin-dev

development server for rollup with additional logging and options
MIT License
61 stars 9 forks source link

Is https supported? #32

Closed ws745630 closed 3 months ago

ws745630 commented 3 months ago

I set the server property, but this https doesn't recognize the certificate.It doesn't work

import devServer from 'rollup-plugin-dev'
import httpsLocalhost from 'https-localhost';
const httpsOptions = httpsLocalhost().getCerts();

devServer({
            host: '127.0.0.1',
            port: 8081,
            dirs: ['dist'],
            proxy: [{ from: '/api', to: 'https://test.sdkv3.heartsnet.tw' }],
            server: {
                https: true,
                https: {
                    key: httpsOptions.key,
                    cert: httpsOptions.cert
                }
            },
}),
pearofducks commented 3 months ago

This works fine on my end with a valid key and certificate - my guess is something is goofy with that module or your use of it. (e.g. it looks like getCerts is async, so you might start there)

ws745630 commented 3 months ago

Thanks for the answer. I'm trying