umijs / mako

An extremely fast, production-grade web bundler based on Rust.
https://makojs.dev
MIT License
1.79k stars 65 forks source link

source-map-explorer analyze mako error #1302

Open xiaohuoni opened 3 months ago

xiaohuoni commented 3 months ago

https://github.com/xiaohuoni/mako-or-cra

{
  "scripts": {
    "analyze:cra": "source-map-explorer 'build/static/js/*.js'",
    "analyze": "source-map-explorer 'dist/*.js'",
    "build": "mako build",
    "build:cra": "react-scripts build",
    "start": "mako build --watch",
    "start:cra": "react-scripts start"
  },
}

# Product size difference

## mako build 4.5MB

## cra build 1.4MB

mako analyze

I want to use source-map-explorer to analyze mako products, but I get an error.

https://create-react-app.dev/docs/analyzing-the-bundle-size/

source-map-explorer 'dist/*.js'

> source-map-explorer 'dist/*.js'

dist/index.js
  Your source map refers to generated column 29 on line 30409, but the source only contains 28 column(s) on that line.
  Check that you are using the correct source map.
dist/src_pages_home_index_tsx-async.js
  Your source map refers to generated column 28 on line 765, but the source only contains 27 column(s) on that line.
  Check that you are using the correct source map.
dist/src_pages_about_index_tsx-async.js
  Unable to map 1006/1229 bytes (81.86%)
dist/src_pages_model_index_tsx-async.js
  Unable to map 2217/2781 bytes (79.72%)

https://github.com/xiaohuoni/mako-or-cra

xiaohuoni commented 3 months ago

mako build 需要 --mode production 😊