build: show error if firebase-config is missing

This commit is contained in:
Miodec 2023-08-31 20:19:33 +02:00
parent 87e882b94d
commit 76537fae4f

View file

@ -2,6 +2,7 @@ const { resolve } = require("path");
const { merge } = require("webpack-merge");
const BASE_CONFIG = require("./config.base");
const ExtraWatchWebpackPlugin = require("extra-watch-webpack-plugin");
const fs = require("fs");
/** @type { import('webpack').Configuration } */
const DEV_CONFIG = {
@ -24,4 +25,9 @@ const DEV_CONFIG = {
],
};
if (!fs.existsSync(resolve(__dirname, "../src/constants/firebase-config.ts"))) {
const msg = `File firebase-config.ts is missing! Please duplicate firebase-config-example.ts and rename it to firebase-config.ts. If you are using Firebase, fill in the values in the config file. If not, you can leave the fields blank.`;
throw new Error(msg);
}
module.exports = merge(BASE_CONFIG, DEV_CONFIG);