web-infra-dev / rsdoctor

A one-stop build analyzer for Rspack and Webpack.
https://rsdoctor.dev/
MIT License
331 stars 20 forks source link

[Feature]: Bundle Analysis Support for rspack and webpack's bannerPlugin. #345

Closed easy1090 closed 1 month ago

easy1090 commented 1 month ago

What problem does this feature solve?

When BannerPlugin is used in the rspack project to add templates code to the assets, it will cause Rsdoctor's Bundle parsing to fail. In summary, Rsdoctor bundle analysis is required to support Banner Plugin.

demo

// rspack.config.js

plugins: [
    new rspack.BannerPlugin({
      test: /\.js/,
      banner,
      raw: true,
    }),

]

当项目中使用 BannerPlugin 对产物添加模板代码时,会导致 Rsdoctor 的 Bundle 解析失败,综上,需要 Rsdoctor Bundle 分析支持 Banner Plugin 能力。

What does the proposed API look like?

empty