plasmo icon indicating copy to clipboard operation
plasmo copied to clipboard

[BUG] Why does the “chrome-mv3-dev” file built in my development environment take up 61 MB?

Open IronManSuper opened this issue 4 months ago • 1 comments

What happened?

Hello Plasmo author, this is my first time working with Chrome extensions and Plasmo. I am very curious about it. Why does the “chrome-mv3-dev” file built in my development environment take up 61 MB, while the prod version is only 2.3 MB? I am a bit confused about what caused this, as I only wrote a demo. Please tell me the reason. I am very curious about this. Below is my package.json and code.

{
    "name": "first-chrome-extension",
    "displayName": "first chrome [extension",](url)
    "version": "0.0.1",
    "description": "xxx",
    "author": "elvin",
    "scripts": {
        "dev": "plasmo dev --verbose --hmr-host=0.0.0.0 --hmr-port=1815 --serve-host=0.0.0.0 --serve-port=1012",
        "build": "plasmo build --verbose",
        "package": "plasmo package",
        "format": "prettier --write .",
        "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
        "prepare": "husky",
        "cz": "git add . && git-cz"
    },
    "config": {
        "commitizen": {
            "path": "node_modules/cz-customizable"
        },
        "cz-customizable": {
            "config": ".cz-config.ts"
        }
    },
    "externals": ["react", "react-dom", "antd"], 
    "dependencies": {
        "@ant-design/cssinjs": "1.24.0",
        "@ant-design/icons": "6.0.0",
        "antd": "5.26.7",
        "antd-style": "3.7.1",
        "plasmo": "0.90.5",
        "react": "18.2.0",
        "react-dom": "18.2.0",
        "styled-components": "6.1.19"
    },
    "devDependencies": {
        "@babel/core": "^7.12.0",
        "@eslint/js": "^9.33.0",
        "@ianvs/prettier-plugin-sort-imports": "4.1.1",
        "@types/chrome": "0.0.258",
        "@types/node": "20.11.5",
        "@types/react": "18.2.48",
        "@types/react-dom": "18.2.18",
        "babel-plugin-styled-components": "2.1.4",
        "commitizen": "4.3.1",
        "commitlint-config-gitmoji": "2.3.1",
        "cz-customizable": "7.4.0",
        "eslint": "^9.33.0",
        "eslint-config-prettier": "^10.1.8",
        "eslint-plugin-prettier": "^5.5.4",
        "eslint-plugin-react": "^7.37.5",
        "eslint-plugin-react-hooks": "^5.2.0",
        "eslint-plugin-react-refresh": "^0.4.20",
        "globals": "^16.3.0",
        "husky": "9.1.7",
        "jiti": "^2.5.1",
        "lint-staged": "16.1.5",
        "prettier": "3.2.4",
        "typescript": "5.3.3",
        "typescript-eslint": "^8.39.0"
    },
    "manifest": {
        "host_permissions": [
            "https://*/*"
        ],
        "permissions": [
            "tabs"
        ]
    },
    "resolutions": {
        "styled-components": "^6"
    }
}
Image Image Image Image Image

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output


(OPTIONAL) Contribution

  • [ ] I would like to fix this BUG via a PR

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct
  • [x] I checked the current issues for duplicate problems.

IronManSuper avatar Aug 14 '25 13:08 IronManSuper

The js code in the dev environment is not compressed, so it is large in size... Even if you didn't write the code, the dependencies you added exist.

zystudios avatar Sep 04 '25 10:09 zystudios