web-infra-dev / rsdoctor

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

feat: support for banner plugin. #357

Closed easy1090 closed 1 month ago

easy1090 commented 1 month ago

Summary

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,
    }),

]

Turn on InternalBannerPlugin support in two cases:

  1. Plugins that detect Compiler options have plug-in name === "BannerPlugin';

  2. The second is to open it manually:


new RsdoctorRspackPlugin (

  supports: {

    banner: true

  }
)

When InternalBannerPlugin is turned on, do not turn on Rsdoctor in the online template.

Related Links

345

netlify[bot] commented 1 month ago

Deploy Preview for rsdoctor ready!

Name Link
Latest commit 096faf23a533833c07303ea180ac9c6ab415a284
Latest deploy log https://app.netlify.com/sites/rsdoctor/deploys/665831aa35b85f0008a53b9b
Deploy Preview https://deploy-preview-357--rsdoctor.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.