Files
Luke SandbergandGitHub eaad5b4c14 Enable prettier for turbopack (#78559)
Enable prettier for turbopack

While the majority of the javascript in turbopack is for tests, this code is generally hand authored so prettier will help us.  There are also core parts of turbopack implemented in JavaScript/TypeScript so a formatter will help.

This was done by simply fixing prettier ignore and chasing lint errors.  There were a few fun issues

* We had a test file called `won't-run-tla.js` and this triggered a bug in our eslint precommit hook.  The simplest thing was to simply drop the `'` character so that is what i did.  I spent a small amount of time trying to narrow this down't in the `lint-staged` dependency but failed, so i think the problem is probably in `eslint`, but it isn't really clear.
* We had another test exercising `import.meta` but in a file called `.cjs`, which prettier rejects due its default `babel` parser.  So i excluded this from prettier.
2025-04-29 11:38:46 -07:00

1.5 KiB

@vercel/experimental-nft-next-plugin

Installation

  • yarn add -D @vercel/experimental-nft-next-plugin
  • npm install -D @vercel/experimental-nft-next-plugin
  • pnpm install -D @vercel/experimental-nft-next-plugin

Usage

// next.config.js

const { createNodeFileTrace } = require('@vercel/experimental-nft-next-plugin')

const withNodeFileTrace = createNodeFileTrace({
  // experimental nft options
  log: {
    all: true,
  },
})

module.exports = withNodeFileTrace({
  // next config
})

experimental nft options

Note

The default options should work fine.

  • cwd?: string, default is process.cwd(), you can override it to specify another directory to run experimental nft.
  • contextDirectory?: string, relative to cwd, default is .. It must be the directory where the node_modules directory is located. If you are in the monorepo, you should set it to the root directory of the monorepo. For yarn2+/npm workspaces, the default value will respect the PROJECT_CWD and npm_config_local_prefix environment variables injected by yarn/npm client. If the default value doesn't work, you can override it to specify the root directory of the monorepo.
  • path?: string, additional path which will be appended into the PATH environment variable.
  • log?.all?: boolean, default is false, whether to show all logs.
  • log?.level?: string, default is error, the log level.
  • log?.detail?: boolean, default is false, whether to expand the log details.