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..9b965a5 --- /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(path.resolve("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 + }); +}