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 | |
parent | 443a6a59eeab9e14c070a78c3b93e40cfeb20096 (diff) | |
download | monkeytype-1bd0b4894d6e8e61a77305784c6ef6482ef78480.tar.gz monkeytype-1bd0b4894d6e8e61a77305784c6ef6482ef78480.zip |
build: moved firebase config check to gulpfile
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/gulpfile.js | 11 | ||||
-rw-r--r-- | frontend/webpack/config.dev.js | 8 |
2 files changed, 11 insertions, 8 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) { diff --git a/frontend/webpack/config.dev.js b/frontend/webpack/config.dev.js index c1f421a95..e24ce819c 100644 --- a/frontend/webpack/config.dev.js +++ b/frontend/webpack/config.dev.js @@ -2,7 +2,6 @@ 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 = { @@ -25,11 +24,4 @@ const DEV_CONFIG = { ], }; -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); -} - module.exports = merge(BASE_CONFIG, DEV_CONFIG); |