Migrate to yarn PnP: integrating webpack resolve.modules with pnp

Viewed 417

I use a similar pattern from the webpack documentation so that I can traverse my components like modules. Instead of using ../../../path/to/component. I just do /path/to/component.

I am using yarn@latest and hoping to migrate to Plug n Play (pnp). I am wondering if there is a way to migrate this configuration so I can still take advantage of it. Possibly a way to require.resolve all modules?

const path = require('path');

module.exports = {
  //...
  resolve: {
    modules: [path.resolve(__dirname, 'src'), 'node_modules'],
  },
};
1 Answers
Related