From 6a067e83c7506bcc921422a5fe0b4c3c07973ba1 Mon Sep 17 00:00:00 2001 From: Ryan Roemer Date: Sat, 2 Apr 2022 22:18:38 -0700 Subject: [PATCH 1/2] Add start of generation script --- next.config.js | 3 --- scripts/config.js | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 scripts/config.js diff --git a/next.config.js b/next.config.js index 6d6102e..7da7c63 100644 --- a/next.config.js +++ b/next.config.js @@ -14,8 +14,5 @@ module.exports = { assetPrefix: BASE_PATH, env: { BASE_PATH - }, - future: { - webpack5: true } }; diff --git a/scripts/config.js b/scripts/config.js new file mode 100644 index 0000000..555307c --- /dev/null +++ b/scripts/config.js @@ -0,0 +1,27 @@ +#!/usr/bin/env node + +"use strict"; + +const path = require("path"); + +const { PHASE_PRODUCTION_SERVER } = require("next/dist/shared/lib/constants"); +const { "default": loadConfig } = require("next/dist/server/config"); + +const nextConf = require("../next.config"); +const { error } = console; + +// ============================================================================ +// Script +// ============================================================================ +const getConfig = async () => { + const dir = path.resolve(".."); + const config = await loadConfig(PHASE_PRODUCTION_SERVER, dir, nextConf); + console.log("TODO CONFIG", { config }); +}; + +if (require.main === module) { + getConfig().catch((err) => { + error(err); + process.exit(1); // eslint-disable-line no-process-exit + }); +} From 0dac2b2261de0293c379883219687cb2b68477c5 Mon Sep 17 00:00:00 2001 From: Ryan Roemer Date: Mon, 4 Apr 2022 16:49:43 -0700 Subject: [PATCH 2/2] WIP --- scripts/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config.js b/scripts/config.js index 555307c..9b965a5 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -7,7 +7,7 @@ const path = require("path"); const { PHASE_PRODUCTION_SERVER } = require("next/dist/shared/lib/constants"); const { "default": loadConfig } = require("next/dist/server/config"); -const nextConf = require("../next.config"); +const nextConf = require(path.resolve("next.config")); const { error } = console; // ============================================================================