Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] 支持 yarn --pnp #16

Closed
beanlee opened this issue Mar 13, 2019 · 3 comments
Closed

[Feature Request] 支持 yarn --pnp #16

beanlee opened this issue Mar 13, 2019 · 3 comments
Assignees

Comments

@beanlee
Copy link
Member

beanlee commented Mar 13, 2019

Is your feature request related to a problem? Please describe.
当前项目使用 yarn --pnp 安装依赖时,无法支持 rocketact-plugin-xxx

Describe the solution you'd like
调整扫描插件的实现,支持 pnp

Describe alternatives you've considered
获取可以通过你今天分享提到 pnp 的API来获取插件的实际地址来 require

packages/rocketact-scripts

resolveInstalledPlugins() {
    const installedPlugins = Object.keys(this.pkg.dependencies || {})
      .filter(isPlugin)
      .concat(Object.keys(this.pkg.devDependencies || {}).filter(isPlugin));
    installedPlugins.forEach(plugin =>
      require(resolveToAppRoot(`./node_modules/${plugin}`))(new CoreAPI(this))
    );
  }
@beanlee beanlee changed the title [Feature Request] 支持 yarn --pnp [Feature Request] 支持 yarn --pnp Mar 13, 2019
@loveky loveky self-assigned this Mar 13, 2019
@loveky
Copy link
Member

loveky commented Mar 13, 2019

Will investigate on this in next few days

@loveky
Copy link
Member

loveky commented Mar 22, 2019

Yarn PnP support has been add in b02b04a

Known issue: Tsc currently do not support PnP(see microsoft/TypeScript#28289). That means if we enable PnP in a TS project (not only Roecketact projects), the TS engine cannot find the type file which installed as @types/xxx packages and leads to a bunch of type errors/warnings. That means currently PnP can only be enabled in JavaScript projects.

@loveky loveky closed this as completed Mar 22, 2019
@beanlee
Copy link
Member Author

beanlee commented Mar 22, 2019

Okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants