web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
8.57k stars 503 forks source link

ProgressPlugin - weird result on arco-pro example #4890

Closed xc2 closed 3 months ago

xc2 commented 8 months ago

System Info

  System:
    OS: macOS 14.0
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 173.95 MB / 32.00 GB
    Shell: 3.6.1 - /usr/local/bin/fish
  Binaries:
    Node: 20.10.0 - ~/.managed/n/bin/node
    npm: 10.2.3 - ~/.managed/n/bin/npm
  Browsers:
    Chrome: 119.0.6045.199
    Firefox: 116.0.2
    Safari: 17.0
  npmPackages:
    @rspack/cli: workspace:* => 0.4.1 
    @rspack/core: workspace:* => 0.4.1 
    @rspack/plugin-html: workspace:* => 0.4.1 
    @rspack/plugin-react-refresh: workspace:* => 0.4.1 

Details

when i was building arco-pro example with progress profile output, i found it somehow weird.

image
diff --git a/examples/arco-pro/rspack.config.js b/examples/arco-pro/rspack.config.js
index fc65bb451..c296ead08 100644
--- a/examples/arco-pro/rspack.config.js
+++ b/examples/arco-pro/rspack.config.js
@@ -112,7 +112,9 @@ const config = {
                        favicon: path.join(__dirname, "public", "favicon.ico")
                }),
                new ReactRefreshPlugin(),
-           new rspack.ProgressPlugin()
+         new rspack.ProgressPlugin({
+                 profile: true
+         })
        ],
        infrastructureLogging: {
                debug: false

it told building a small css nprogress/nprogress.css takes long.

when i commented out importing nprogress/nprogress.css and ../assets/header-banner.png, the total cost didn't change and an other module color-name became the heavy thing.

image
diff --git a/examples/arco-pro/rspack.config.js b/examples/arco-pro/rspack.config.js
index fc65bb451..c296ead08 100644
--- a/examples/arco-pro/rspack.config.js
+++ b/examples/arco-pro/rspack.config.js
@@ -112,7 +112,9 @@ const config = {
                        favicon: path.join(__dirname, "public", "favicon.ico")
                }),
                new ReactRefreshPlugin(),
-           new rspack.ProgressPlugin()
+         new rspack.ProgressPlugin({
+                 profile: true
+         })
        ],
        infrastructureLogging: {
                debug: false
diff --git a/examples/arco-pro/src/pages/user/info/style/index.module.less b/examples/arco-pro/src/pages/user/info/style/index.module.less
index 491fe2427..62e55cc3f 100644
--- a/examples/arco-pro/src/pages/user/info/style/index.module.less
+++ b/examples/arco-pro/src/pages/user/info/style/index.module.less
@@ -29,7 +29,6 @@
 }

 .header::after {
-  background: url('../assets/header-banner.png') no-repeat;
   background-size: 100%;
   height: 200px;
   width: 100%;
diff --git a/examples/arco-pro/src/style/global.less b/examples/arco-pro/src/style/global.less
index 2fa5f9d80..1e8ae5f59 100644
--- a/examples/arco-pro/src/style/global.less
+++ b/examples/arco-pro/src/style/global.less
@@ -1,5 +1,4 @@
 @import '@arco-themes/react-arco-pro/index.less';
-@import 'nprogress/nprogress.css';

 html,
 body {

Reproduce link

No response

Reproduce Steps

as above

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

xc2 commented 3 months ago

Close as duplicated