mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-27 08:13:28 +08:00
build: show error if firebase-config is missing
This commit is contained in:
parent
87e882b94d
commit
76537fae4f
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue