From 7463f606f2d7182e2f65691cf1be05dcf90d8dce Mon Sep 17 00:00:00 2001 From: rot1024 Date: Thu, 4 Nov 2021 17:46:50 +0900 Subject: [PATCH] chore: load local reearth-config.json --- .gitignore | 1 + webpack.config.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 7ad7674e2..30310028c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ __screenshots__ /cypress/videos /cypress/screenshots /.env* +/reearth-config.json diff --git a/webpack.config.js b/webpack.config.js index bba776875..d710da2a7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,6 +15,14 @@ const webpack = require("webpack"); const pkg = require("./package.json"); +let reearthConfig = {}; +try { + // eslint-disable-next-line node/no-missing-require + reearthConfig = require("./reearth-config.json"); +} catch { + // ignore +} + module.exports = (env, args = {}) => { const isProd = args.mode === "production"; const envfile = loadEnv(Object.keys(env || {}).find(k => !k.startsWith("WEBPACK_"))); @@ -28,6 +36,7 @@ module.exports = (env, args = {}) => { ...process.env, }, }), + ...reearthConfig, }; return {