How to use the next-server/dist/lib/constants.PHASE_PRODUCTION_BUILD function in next-server

To help you get started, we’ve selected a few next-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github danielcondemarin / serverless-next.js / packages / serverless-nextjs-plugin / lib / parseNextConfiguration.js View on Github external
let nextLoadConfig;
try {
  nextLoadConfig = require("next-server/dist/server/config").default;
  PHASE_PRODUCTION_BUILD = require("next-server/dist/lib/constants")
} catch (e) {
  // Some files were moved in the dist/ directory in next.js 9.0.6
  // check the new location if the old location failed.
  nextLoadConfig = require("next/dist/next-server/server/config").default;
  PHASE_PRODUCTION_BUILD = require("next/dist/next-server/lib/constants")

const s3Urls = require("@mapbox/s3urls");
const createError = require("../utils/createError");

module.exports = nextConfigDir => {
  if (typeof nextConfigDir !== "string") {
    throw createError("Provide a valid next.config file path");