Have ideas to improve npm?Join in the discussion! »

@rajzik/config-next
TypeScript icon, indicating that this package has built-in type declarations

3.0.9 • Public • Published

Next Config

Factory functions for creating preset Next configurations. Primarily used in unison with the Lumos CLI.

Extending config

Update package.json:

{
  "lumos": {
    "next": {
      "target": "serverless"
    }
  }
}

Create file in configs folder:

configs/next.js

// TBD
modules.exports = {
  target: 'serverless',
};

configs/next.js

modules.exports = (phase, { defaultConfig }) => {
  if (phase === PHASE_DEVELOPMENT_SERVER) {
    return {
      /* development only config options here */
    };
  }
 
  return {
    /* config options for all phases except development here */
  };
};

Settings

Main settings

interface NextOptions {
  analyzeBundle?: boolean;
  buildFolder?: string;
  root?: string;
  target?: 'server' | 'serverless' | 'experimental-serverless-trace';
  srcFolder: string;
}

Default values

{
  analyzeBundle = false,
  root = WEBPACK_ROOT,
  buildFolder = '.next',
  target = 'server',
  srcFolder = 'src',
  nextOptions = {},
}

ENV Options

  • LUMOS_BUILD_FOLDER=<string>

    • define build folder for current build
    cross-env LUMOS_BUILD_FOLDER = 'build' lumos next build
  • LUMOS_SRC_FOLDER=<string>

    • define src folder for current build
    cross-env LUMOS_SRC_FOLDER='src' lumos next build
  • LUMOS_TARGET=<server|serverless|experimental-serverless-trace>

    • Define target for current build
      cross-env LUMOS_TARGET='server' lumos next build

Install

npm i @rajzik/config-next

DownloadsWeekly Downloads

0

Version

3.0.9

License

MIT

Unpacked Size

272 kB

Total Files

14

Last publish

Collaborators

  • avatar