diff --git a/frontend/app-config/webpack.config.js b/frontend/app-config/webpack.config.js index be6cc60bc..52f127c70 100644 --- a/frontend/app-config/webpack.config.js +++ b/frontend/app-config/webpack.config.js @@ -10,6 +10,14 @@ function root() { return path.join.apply(path, [appRoot].concat(newArgs)); }; +function tryGetFile(file) { + try { + return fs.readFileSync(path.resolve(__dirname, file)); + } catch (ex) { + return undefined; + } +} + const plugins = { // https://github.com/webpack-contrib/mini-css-extract-plugin MiniCssExtractPlugin: require('mini-css-extract-plugin'), @@ -211,8 +219,8 @@ module.exports = function (env) { 'Access-Control-Allow-Origin': '*' }, https: { - key: fs.readFileSync(path.resolve(__dirname, 'localhost-key.pem')), - cert: fs.readFileSync(path.resolve(__dirname, 'localhost.pem')), + key: tryGetFile('localhost-key.pem'), + cert: tryGetFile('localhost.pem'), }, historyApiFallback: true, }