重要提示: 此中文文档针对的是 Yarn 2 版本。
有关 1.x 版本的中文文档,请点击进入 yarn.bootcss.com。
Yarn
pnpify --sdkpnpify run

pnpify run

Run a command with a virtual node_modules folder.

Usage

$> pnpify run <commandName> ...

Examples

Run Angular using PnPify :

pnpify ng build

Options

Definition
Description

--cwd #0

The directory to run the command in

Details

When a non-PnP-compliant project tries to access the node_modules directories (for example through readdir or readFile), PnPify intercepts those calls and converts them into calls to the PnP API. Then, based on the result, it simulates the existence of a virtual node_modules folder that the underlying tool will then consume - still unaware that the files are extracted from a virtual filesystem.

The run keyword can be omitted if the executed command doesn't conflict with built-in commands.