Merge pull request #13338 from lsiric/feature/support-custom-certificate-for-webpack-dev-server
passing https.cert and https.key options to the webpack dev server
This commit is contained in:
@@ -40,6 +40,7 @@ export async function serveBundle(options: ServeOptions) {
|
||||
isDev: true,
|
||||
baseUrl: url,
|
||||
});
|
||||
|
||||
const compiler = webpack(config);
|
||||
|
||||
const server = new WebpackDevServer(
|
||||
@@ -60,7 +61,15 @@ export async function serveBundle(options: ServeOptions) {
|
||||
// See https://github.com/facebookincubator/create-react-app/issues/387.
|
||||
disableDotRule: true,
|
||||
},
|
||||
https: url.protocol === 'https:',
|
||||
https:
|
||||
url.protocol === 'https:'
|
||||
? {
|
||||
cert: options.backendConfig.getString(
|
||||
'app.https.certificate.cert',
|
||||
),
|
||||
key: options.backendConfig.getString('app.https.certificate.key'),
|
||||
}
|
||||
: false,
|
||||
host,
|
||||
port,
|
||||
proxy: pkg.proxy,
|
||||
|
||||
@@ -31,6 +31,7 @@ export type ServeOptions = BundlingPathsOptions & {
|
||||
checksEnabled: boolean;
|
||||
frontendConfig: Config;
|
||||
frontendAppConfigs: AppConfig[];
|
||||
backendConfig: Config;
|
||||
};
|
||||
|
||||
export type BuildOptions = BundlingPathsOptions & {
|
||||
|
||||
@@ -96,11 +96,15 @@ export async function loadCliConfig(options: Options) {
|
||||
});
|
||||
const frontendConfig = ConfigReader.fromConfigs(frontendAppConfigs);
|
||||
|
||||
const backendAppConfigs = schema.process(appConfigs);
|
||||
const backendConfig = ConfigReader.fromConfigs(backendAppConfigs);
|
||||
|
||||
return {
|
||||
schema,
|
||||
appConfigs,
|
||||
frontendConfig,
|
||||
frontendAppConfigs,
|
||||
backendConfig,
|
||||
};
|
||||
} catch (error) {
|
||||
const maybeSchemaError = error as Error & { messages?: string[] };
|
||||
|
||||
Reference in New Issue
Block a user