'What path do I use in yarn 2 with plug 'n play to access a specific file in a package?

This path was working node_modules/webpack/bin/webpack.js in the following command in Yarn 1...

yarn --cwd packages/mypackage/ node --trace-deprecation node_modules/webpack/bin/webpack.js --env env=dev

I moved to Yarn 2 (berry) with plug 'n play (PNP) and Workspaces so there's not a node_modules folder (the module I need is stored a zip file at .yarn/cache/webpack-npm-5.64.0-a89fa9e176-9d32a61d98.zip. The file within the zip upzips to /node_modules/webpack/bin/webpack.js.

Here's what I tried, but I'm getting a path error, so have the path wrong still...

yarn workspace @myworkspace/mypackage node --trace-deprecation .yarn/plugins/@webpack-npm/bin/webpack.js --env env=dev

If there's a better way to do this that doesn't require writing out this whole path, I'm all for that too.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source