{"id":28275188,"url":"https://github.com/juicecube/mlz-pack","last_synced_at":"2026-03-10T02:04:05.175Z","repository":{"id":35240196,"uuid":"205767714","full_name":"juicecube/mlz-pack","owner":"juicecube","description":"mlz-pack","archived":false,"fork":false,"pushed_at":"2024-01-03T03:40:28.000Z","size":6430,"stargazers_count":6,"open_issues_count":23,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-19T13:47:30.889Z","etag":null,"topics":["mlz-pack","typescript","webpack"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juicecube.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-02T03:08:19.000Z","updated_at":"2021-11-12T06:59:35.000Z","dependencies_parsed_at":"2024-01-03T03:41:32.424Z","dependency_job_id":"6b8a6993-b718-4713-ac55-f6c57366585e","html_url":"https://github.com/juicecube/mlz-pack","commit_stats":{"total_commits":282,"total_committers":13,"mean_commits":"21.692307692307693","dds":0.1028368794326241,"last_synced_commit":"c02eb66f5a7a8438c7307ccfb29e153da2ddaaeb"},"previous_names":[],"tags_count":113,"template":false,"template_full_name":null,"purl":"pkg:github/juicecube/mlz-pack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juicecube%2Fmlz-pack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juicecube%2Fmlz-pack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juicecube%2Fmlz-pack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juicecube%2Fmlz-pack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juicecube","download_url":"https://codeload.github.com/juicecube/mlz-pack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juicecube%2Fmlz-pack/sbom","scorecard":{"id":541052,"data":{"date":"2025-08-11","repo":{"name":"github.com/juicecube/mlz-pack","commit":"e41149d768cf0f3192d5dbbc9900a9e086159db1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/npmpublish.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/juicecube/mlz-pack/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/juicecube/mlz-pack/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/juicecube/mlz-pack/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/juicecube/mlz-pack/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/juicecube/mlz-pack/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/juicecube/mlz-pack/release.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'feat/weebpack5'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"127 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-qgfr-5hqp-vrw9","Warn: Project is vulnerable to: GHSA-3wcq-x3mq-6r9p","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-6x33-pw7p-hmpq","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-r6rj-9ch6-g264","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-c9g6-9335-x697","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-7xcx-6wjh-7xp2","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-9m6j-fcg5-2442","Warn: Project is vulnerable to: GHSA-hh27-ffr2-f2jc","Warn: Project is vulnerable to: GHSA-rqff-837h-mm52","Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T08:13:24.770Z","repository_id":35240196,"created_at":"2025-08-20T08:13:24.770Z","updated_at":"2025-08-20T08:13:24.770Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30322637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mlz-pack","typescript","webpack"],"created_at":"2025-05-21T03:13:41.864Z","updated_at":"2026-03-10T02:04:00.167Z","avatar_url":"https://github.com/juicecube.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mlz-pack | 内置webpack的依赖处理的打包工具\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4c849bc9b5664c31b61449975144e615)](https://app.codacy.com/gh/juicecube/mlz-pack?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=juicecube/mlz-pack\u0026utm_campaign=Badge_Grade_Dashboard)\n[![CircleCI](https://travis-ci.org/juicecube/mlz-pack.svg?branch=master)](https://travis-ci.org/juicecube/mlz-pack)\n\n## 安装\n\n本地项目安装\n\n由于内含mozjpeg-bin，optipng-bin，sentry等binary包，需要.npmrc中添加以下配置，直接安装很大几率安装不成功。\n\n```\nmozjpeg_binary_site=https://npm.taobao.org/mirrors/mozjpeg-bin\noptipng_binary_site=https://npm.taobao.org/mirrors/optipng-bin\nsentrycli_cdnurl=https://npm.taobao.org/mirrors/sentry-cli\n```\n```\nnpm i @mlz/pack -D\n```\n\n## 使用\n\n支持serve和build两种命令，server用于本地开发，build用于代码构建。\n\npackage.json\n```js\n{\n  \"scripts\": {\n    \"start\": \"mlz-pack serve\",\n    \"build\": \"mlz-pack build\"\n    ...\n  }\n}\n```\nserve命令的使用\n\n```\nUsage: mlz-pack serve [options] [entry]\n\nserve your project in development mode\n\nOptions:\n  -p, --port \u003cport\u003e  port used by the server (default: 8080)\n  -h, --help         output usage information\n```\n\nbuild命令的使用\n\n```\nUsage: mlz-pack build [options] [entry]\n\nbuild your project from a entry file(.js||.ts||.tsx), default: src/index.tsx\n\nOptions:\n  -e, --env \u003cenvironment\u003e  dev or prod（default: prod）\n  -d, --dest \u003cdest\u003e        output directory (default: build)\n  -h, --help               output usage information\n```\n\neject命令使用\n\n```\nUsage: mlz-pack eject [options]\n\neject webpack config.\n\nOptions:\n  -h, --help  output usage information\n```\n\n## 自定义配置\n\n读取项目根目录下的**mlz-pack.js**\n\n**Tips:**\n\n开启热加载需要在入口文件加入以下代码：\n\n```\nif(module.hot){\n  module.hot.accept()\n}\n```\n\n### webpack配置\n\n| Name \t| Type \t| Default \t| Description \t|\n|:-------------------------------------:\t|:--------------------------------------------:\t|:---------------------------------------------------------------------------------:\t|:---------------------------------------------------------------------------------------------------:\t|\n| **[`rootPath`](#rootPath)** \t| `string` \t| `process.cwd()` \t| 项目的根目录 \t|\n| **[`entryPath`](#entryPath)** \t| `string \\| string[] \\| Entry \\| EntryFunc` \t| `{ index: path.resolve(process.cwd(), 'src/index.tsx') }` \t| 入口文件（webpack的entry） \t|\n| **[`output`](#output)** \t| `Object` \t| [webpack: output](https://webpack.js.org/configuration/output/) \t| 项目打包输出的相关配置 \t|\n| **[`target`](#target)** \t| `string` \t| `web` \t| 项目打包的目标环境 \t|\n| **[`dropConsole`](#dropConsole)** \t| `boolean` \t| `true` \t| 删除console \t| \n| **[`buildPath`](#buildPath)** \t| `string` \t| `build` \t| build文件 \t|\n| **[`publicPath`](#publicPath)** \t| `string` \t| `/` \t| js,css,图片等资源前缀 \t|\n| **[`assetsPublicPath`](#assetsPublicPath)** \t| `string` \t| `/` \t| 特别指定图片，文件等资源前缀，默认与publicPath保持一致 \t|\n| **[`tsconfig`](#tsconfig)** \t| `string` \t| `undefined` \t| tsconfig路径（可选） \t|\n| **[`devServer`](#devServer)** \t| `object` \t| `{port: 8080, noInfo: true, hot: true, inline: true, historyApiFallback: true, stats: 'errors-only', open: true}` \t| dev-server相关配置 \t|\n| **[`pxtorem`](#pxtorem)** \t| `object` \t| `undefined` \t| 是否开启px转rem，还有相关配置 \t|\n| **[`svgr`](#svgr)** \t| `boolean` \t| `false` \t| 是否开启svgr，可以使svg作为组件使用 \t|\n| **[`cssScopeName`](#cssScopeName)** \t| `string` \t| `[local]__[hash:base64:5] \\| [path][name]__[local]` \t| css的className编译规则，默认：dev环境是`[path][name]__[local]`，正式环境是`[name]__[hash:base64:5]` \t|\n| **[`alias`](#alias)** \t| `{[key:string]:string}` \t| `undefined` \t| 别名，可不填，默认会读tsconfig里的paths \t|\n| **[`definePlugin`](#definePlugin)** \t| `{[key:string]:any}` \t| `undefined` \t| 全局变量 \t|\n| **[`imageminPlugin`](#imageminPlugin)** \t| `boolean` \t| `true` \t| 图片压缩配置 \t|\n| **[`analyzePlugin`](#analyzePlugin)** \t| `boolean` \t| `false` \t| 是否开启bundle分析 \t|\n| **[`htmlPlugin`](#htmlPlugin)** \t| `Object` \t| `{filename: 'index.html',template: path.resolve(process.cwd(), 'src/index.ejs')}` \t| htmlplugin的参数设置 \t|\n| **[`sentryPlugin`](#sentryPlugin)** \t| `Object` \t| `{}` \t| sentryPlugin配置，更新了sentry的配置方式见详情 \t|\n| **[`hardSourcePlugin`](#hardSourcePlugin)** \t| `boolean` \t| `false` \t| 开启hard-source-webpack-plugin，用于build缓存 \t|\n| **[`extraCssPlugin`](#extraCssPlugin)** \t| `boolean` \t| `true` \t| 是否在正式环境开启mini-css-extract-plugin \t|\n| **[`libs`](#libs)** \t| `{[key:string]:string[]}` \t| `undefined` \t| 用于单独切分第三方依赖的bundle的配置 \t|\n| **[`splitChunks`](#splitChunks)** \t| `undefined | 'libs' | function () =\u003e object` \t| `undefined` \t| 自定义splitChunks \t|\n| **[`loaderOptions`](#loaderOptions)** \t| `RuleSetRule[]` \t| `undefined` \t| loader扩展 \t|\n| **[`pluginOptions`](#pluginOptions)** \t| `any[]` \t| `undefined` \t| plugin扩展 \t|\n| **[`babel`](#babel)** \t| `any` \t| `undefined` \t| babel扩展 \t|\n| **[`codeInspector`](#codeInspector)** | `Object` | `false` | 点击页面dom跳转到对应源码,只在dev添加 |\n\n### `rootPath`\n\nType: `string` Default: `process.cwd()`\n\n设置项目的根目录，一般不用设置。\n\n### `target`\n\nType: `string` Default: `web`\n\n设置项目打包的目标环境，参数值有：`async-node`,`electron-main`,`electron-renderer`,`electron-preload`,`node`,`node-webkit`,`web`,`webworker`。\n\n### `dropConsole`\n\nType: `boolean` Default: `true`\n\n是否删除console\n\n### `entryPath`\n\nType: `string` Default: `{ index: path.resolve(process.cwd(), 'src/index.tsx') }`\n\n设置项目的入口文件，即webpack的entry配置(只针对单页应用进行设置,暂时没有测试过多页应用)。\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    entryPath: [path.join(__dirname, './src/index.tsx')],\n  }\n}\n```\n\n### `buildPath`\n\nType: `string` Default: `build`\n\nbuild文件夹(绝对地址)，默认是`path.resolve(process.cwd(), 'build')`\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    buildPath: path.resolve(process.cwd(), 'build'),\n  }\n}\n```\n\n### `publicPath`\n\nType: `string` Default: `/`\n\njs,css,图片等资源前缀，默认是`/`，正式环境请设置为cdn的地址\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    publicPath: '/',\n  }\n}\n```\n\n### `assetsPublicPath`\n\nType: `string` Default: `/`\n\n图片，字体等资源前缀，默认与publicPath保持一致\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    assetsPublicPath: '/',\n  }\n}\n```\n\n### `tsconfig`\n\nType: `string` Default: `undefined`\n\n由于使用了 [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin)，默认会读取`cwd`的tsconfig.json中的path来设置webpack的alias。`tsconfig`此配置会设置该plugin的tsconfig的地址。\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    tsconfig: path.resolve(process.cwd(), 'tsconfig.json'),\n  }\n}\n```\n\n### `devServer`\n\nType: `object` Default: `{port: 8080, noInfo: true, hot: true, inline: true, historyApiFallback: true, stats: 'errors-only', open: true}`\n\n开发环境的server的配置，见[webpack-dev-server](https://webpack.js.org/configuration/dev-server/#devserver)。\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    devServer: {\n      port: '8080',\n      open: true,\n    },\n  },\n}\n```\n\n### `svgr`\n\nType: `boolean` Default: `false`\n\n是否开启[svgr](https://github.com/smooth-code/svgr)\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    svgr: true,\n  },\n}\n```\n\n### `pxtorem`\n\nType: \n```\n{\n  rootValue?:number;\n  propList?:string[];\n  selectorBlackList?:string[];\n  replace?:boolean;\n  minPixelValue?:number;\n};\n```\nDefault: `undefined`\n\n是否开启px转rem的功能，并且设置相关配置，有关于移动端适配的方案详细参考文档[移动端适配方案](https://shimo.im/docs/69JqRr9yRCGJXHDv)。\n```\n{\n  rootValue: 100, // 标准设计稿的根元素的font-size\n  unitPrecision: 5, // 小数点位数\n  propList: ['*', '!no-rem'], // 需要转换的属性\n  selectorBlackList: [], // 不需要转换的属性\n  replace: true,\n  mediaQuery: false,\n  minPixelValue: 0, // 最小值\n}\n```\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    pxtorem: {\n      rootValue: 100,\n      propList: [\n        '*',\n        '!min-width',\n        '!border',\n        '!border-left',\n        '!border-right',\n        '!border-top',\n        '!border-bottom',\n      ],\n      selectorBlackList: [\n        'no_rem'\n      ],\n    },\n  },\n}\n```\n\n### `cssScopeName`\n\nType: `string` Default: `[local]__[hash:base64:5] (prod) \\| [path][name]__[local] (dev)\t`\n\nclassName的编译规则，默认：dev环境是[path][name]__[local]，正式环境是[name]__[hash:base64:5]\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    cssScopeName: '[local]__[hash:base64:5]',\n  },\n}\n```\n\n### `alias`\n\nType: `{[key:string]:string}` Default: `undefined`\n\n别名即webpack配置中的alias，可不填，默认会读tsconfig里的paths，别名建议在tsconfig中配置。\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    alias: {src: path.resolve(__dirname, 'src')},\n  },\n}\n```\n\n### `definePlugin`\n\nType: `{[key:string]:any}` Default: `undefined`\n\n全局变量，即webpack中`webpack.DefinePlugin`的配置\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    definePlugin: {DEBUG: false},\n  },\n}\n```\n\n### `imageminPlugin`\n\nType: `boolean` Default: `true`\n\n是否开启图片压缩\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    imageminPlugin: false,\n  },\n}\n```\n\n### `analyzePlugin`\n\nType: `boolean` Default: `false`\n\n是否开启bundle的分析，对于build和资源优化有很大帮助。\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    analyzePlugin: false,\n  },\n}\n```\n\n### `htmlPlugin\t`\n\nType: \n```\n{\n  template?:string;\n  favicon?:string;\n  filename?:string;\n  [key:string]:any;\n}\n```\nDefault:\n```\n{\n  filename: 'index.html',\n  template: path.resolve(process.cwd(), 'src/index.ejs'),\n}\n```\nhtml-plugin配置，用于设置HTML的编译属性\n\n`template`：指html的模板可以是.html|.ejs等文件\n\n`favicon`：favicon小图标的地址\n\n`filename`: 编译后的HTML名称\n\n`[key:string]:any;`: 指的是可写入HTML的变量\n\n默认给了loading变量用于设置HTML的loading减少白屏时间，在HTML中可以直接使用，例如：\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead lang=\"zh-CN\"\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no\"\u003e\n  \u003cmeta name=\"format-detection\" content=\"telephone=no\" /\u003e\n  \u003cmeta name=”renderer” content=”webkit”\u003e\n  \u003ctitle\u003eJuice Cube\u003c/title\u003e\n  \u003c%= htmlWebpackPlugin.options.loading.css %\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003cdiv id=\"root\"\u003e\n    \u003c%= htmlWebpackPlugin.options.loading.html %\u003e\n  \u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    {\n      filename: 'index.html',\n      template: path.resolve(process.cwd(), 'src/index.ejs'),\n      loading: {\n        css: '',\n        html: '',\n      };\n    }\n  },\n}\n```\n\n### `output\t`\n\nType: \n```\n{\n  filename?:string;\n  chunkFilename?:string;\n  [key:string]:any;\n}\n```\nDefault:\n```\ndev.config.js\n{\n  filename: 'js/[name].js',\n  chunkFilename: 'js/[name].js',\n  pathinfo: false,\n}\n\nproduct.config.js \n{\n  filename: 'js/[name].[contenthash].js',\n  chunkFilename: 'js/[name].[contenthash].js',\n}\n```\noutput，用于配置打包输出的相关配置，详细可见：[webpack: output](https://webpack.js.org/configuration/output/)\n\n### `sentryPlugin`\n\nType: `object`\n\nDefault:\n```\n{\n  include: config.buildPath,\n  ignoreFile: '.sentrycliignore',\n  ignore: ['node_modules'],\n  configFile: 'sentry.properties',\n  urlPrefix: config.publicPath,\n  release: version,\n}\n```\nsentryPlugin配置，详细可见：[webpack-sentry-plugin](https://github.com/getsentry/sentry-webpack-plugin#options)\n\n由于webpack-sentry-plugin更新接口。在本库v1.1.3以上的配置方式如下：\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    sentryPlugin: {},\n  },\n}\n```\n\n根目录下新建 **.sentryclirc** 文件\n\n**.sentryclirc**\n\n```\n[defaults]\nurl = [sentry address] // 例如：https://sentry.codemao.cn\norg = [sentry org] // 例如：codemao\nproject = xxx //project名\n[auth]\ntoken = xxx\n```\n\n### `hardSourcePlugin`\n\nType: `boolean` Default: `false`\n\n是否开启[hard-source-webpack-plugin](https://github.com/mzgoddard/hard-source-webpack-plugin)，以便于build缓存的利用。\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    hardSourcePlugin: true,\n  },\n}\n```\n\n### `extraCssPlugin`\n\nType: `boolean` Default: `true`\n\n是否在正式环境开启[mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin)。\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    extraCssPlugin: false,\n  },\n}\n```\n### `postCssPlugins`\nType: Object Array\npostCss 解析css文件插件，配置后覆盖原有\n```\nmodule.exports = {\n  webpack: {\n    postCssPlugins: [{\n      // 插件名\n      name:'tailwindcss', \n      //插件配置\n      options:{\n        ...\n      }\n    }],\n  },\n}\n```\n### `postScssPlugins`\nType: Object Array\npostCss 解析scss文件插件，配置后覆盖原有\n```\nmodule.exports = {\n  webpack: {\n    postCssPlugins: [{\n      // 插件名\n      name:'tailwindcss', \n      //插件配置\n      options:{\n        ...\n      }\n    }],\n  },\n}\n```\n### `libs`\n\nType: `{[key:string]:string[]}` Default: `undefined`\n\n将node_modules里的包进行分类打包，根据不同包的更新频率不同有利于缓存，默认会为第三方包创建名为`venderLibs`的bundle。\n\n例如下边代码会分别生成，名为vender的bundle包含`react`和`react-dom`，名为juice的bundle包含作`@mlz/pack`和`@mlz/lint`，其他的第三方依赖会在名为venderLibs的bundle\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    libs: {\n      vender: ['react', 'react-dom'],\n      juice: ['@mlz/pack', '@mlz/lint'],\n    }\n  },\n}\n```\n### `splitChunks`\n\nType: `undefined | 'libs' | function () =\u003e object` Default: `undefined`\n\n当值为`undefined`时，按照如上文档`libs`api中的相关逻辑\n\n当值为`libs`时，会将node_modules里的包进行分类打包，会将`libs`中的第三方包创建名为对应`[key]`的bundle。不在`libs`中的，则会按照`splitChunks`的`chunks: 'all'`规则进行拆分\n\n当值为`function`类型时，必须返回一个`webpack.splitChunks`类型的的`object`。该类型时提供自定义`splitChunks`的功能\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    splitChunks: 'libs',\n    splitChunks: ()=\u003e{\n      return {\n        chunks: 'all'\n      };\n    },\n  },\n}\n```\n\n### `loaderOptions`\n\nType: `RuleSetRule[]` Default: `undefined`\n\nwebpack的loader扩展\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    loaderOptions: [\n      {\n        test: /\\.svg$/,\n        use: [\n          '@svgr/webpack',\n        ],\n      },\n    ]\n  },\n}\n```\n\n### `pluginOptions`\n\nType: `any[]` Default: `undefined`\n\nwebpack的plugin扩展\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    pluginOptions: [\n      new ProgressBarPlugin(),\n    ]\n  },\n}\n```\n\n### `babel`\n\nType: `any` Default: `undefined`\n\nbabel扩展\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    babel: {\n      'presets': [\n        '@babel/preset-react',\n      ],\n    }\n  },\n}\n```\n\n### `codeInspector`\n\nType: `Object` Default: `false`\n\n版本1.2.4添加\n点击页面dom跳转到对应源码,只在dev添加\nvscode,开启跳转需要配置,参考该链接\nhttps://inspector.fe-dev.cn/guide/start.html#_2-%E9%85%8D%E7%BD%AE-vscode-%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%B7%A5%E5%85%B7\n\n**mlz-pack.js**\n\n```js\nmodule.exports = {\n  webpack: {\n    codeInspector: {\n      hotKeys: ['altKey', 'shiftKey'], // 触发功能的组合键，为 false 或者空数组则关闭组合键触发功能。 \n      showSwitch: false, // 是否在页面展示一个控制源码定位功能的开关，开关打开时和按住组合键的效果是相同的\n    }\n  },\n}\n```\n\n### TODO\n1.定制化配置: 可以通过 mlz-pack --init 初始化配置文件\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuicecube%2Fmlz-pack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuicecube%2Fmlz-pack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuicecube%2Fmlz-pack/lists"}