diff options
author | Miodec <[email protected]> | 2023-09-04 13:29:18 +0200 |
---|---|---|
committer | Miodec <[email protected]> | 2023-09-04 13:29:18 +0200 |
commit | 1bd0b4894d6e8e61a77305784c6ef6482ef78480 (patch) | |
tree | cca6ef6298c9111f8688a655979160d9237506bd /frontend/gulpfile.js | |
parent | 443a6a59eeab9e14c070a78c3b93e40cfeb20096 (diff) | |
download | monkeytype-1bd0b4894d6e8e61a77305784c6ef6482ef78480.tar.gz monkeytype-1bd0b4894d6e8e61a77305784c6ef6482ef78480.zip |
build: moved firebase config check to gulpfile
Diffstat (limited to 'frontend/gulpfile.js')
-rw-r--r-- | frontend/gulpfile.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/frontend/gulpfile.js b/frontend/gulpfile.js index 07e5e0a5b..f9a665d58 100644 --- a/frontend/gulpfile.js +++ b/frontend/gulpfile.js @@ -1,6 +1,8 @@ const { webpack } = require("webpack"); const eslint = require("gulp-eslint-new"); const { task, src, series, watch } = require("gulp"); +const { resolve } = require("path"); +const fs = require("fs"); const webpackDevConfig = require("./webpack/config.dev.js"); const webpackProdConfig = require("./webpack/config.prod.js"); @@ -27,6 +29,15 @@ task("validate-json-schema", function () { const taskWithWebpackConfig = (webpackConfig) => { return async () => { + if ( + !fs.existsSync( + resolve(__dirname, "../src/ts/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. For more information, check CONTRIBUTING_ADVANCED.md`; + throw new Error(msg); + } + return new Promise((resolve, reject) => { webpack(webpackConfig, (err, stats) => { if (err) { |