FAB compiler for NextJS projects.
NextJS is a tricky target for FABs, as it, like a lot of NodeJS server-side JS projects, assumes a fair bit about the environment it runs on. Since version 8, Next has offered two build targets: NodeJS & Serverless. The serverless build has stripped out a lot of the old assumptions and generates a single file per "route" for NextJS. Each of these files shares a lot with each other, so
@fab/nextjs merges these and wraps them in a FAB adapter, so that you end up with a single-file entry point. It's still a bit of a proof of concept, but it works!
$ npm install -g @fab/nextjs $ fab-nextjs COMMAND running command... $ fab-nextjs (-v|--version|version) @fab/nextjs/0.3.2 darwin-x64 node-v12.4.0 $ fab-nextjs --help [COMMAND] USAGE $ fab-nextjs COMMAND ...
fab-nextjs build [DIRECTORY]
Build a NextJS project into a FAB
USAGE $ fab-nextjs build [DIRECTORY] OPTIONS -h, --help show CLI help -o, --output=output [default: fab.zip] Output FAB file -s, --server=server Path to server entry file -v, --version show CLI version -w, --working-dir=working-dir [default: .fab] Working FAB directory --intermediate-only EXAMPLE $ fab-nextjs build
See code: src/commands/build.ts
fab-nextjs help [COMMAND]
display help for fab-nextjs
USAGE $ fab-nextjs help [COMMAND] ARGUMENTS COMMAND command to show help for OPTIONS --all see all commands in CLI
See code: @oclif/plugin-help