{"id":13487228,"url":"https://github.com/tolerance-go/weapp-start","last_synced_at":"2025-03-27T21:32:09.338Z","repository":{"id":57397213,"uuid":"132100870","full_name":"tolerance-go/weapp-start","owner":"tolerance-go","description":"🛠️基于插件机制的小程序编译开发环境，提供多种工具类","archived":true,"fork":false,"pushed_at":"2019-11-01T18:43:01.000Z","size":404,"stargazers_count":42,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T01:32:46.997Z","etag":null,"topics":["scaffold","weapp","weapp-plugin","weapp-start"],"latest_commit_sha":null,"homepage":"","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/tolerance-go.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-04T06:55:37.000Z","updated_at":"2023-08-19T00:28:09.000Z","dependencies_parsed_at":"2022-09-07T11:51:30.191Z","dependency_job_id":null,"html_url":"https://github.com/tolerance-go/weapp-start","commit_stats":null,"previous_names":[],"tags_count":131,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolerance-go%2Fweapp-start","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolerance-go%2Fweapp-start/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolerance-go%2Fweapp-start/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolerance-go%2Fweapp-start/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tolerance-go","download_url":"https://codeload.github.com/tolerance-go/weapp-start/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245907556,"owners_count":20691954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["scaffold","weapp","weapp-plugin","weapp-start"],"created_at":"2024-07-31T18:00:56.853Z","updated_at":"2025-03-27T21:32:08.799Z","avatar_url":"https://github.com/tolerance-go.png","language":"JavaScript","funding_links":[],"categories":["工具"],"sub_categories":[],"readme":"\n\u003cdiv align=center\u003e\n\u003cimage src='./assets/1526620785154.jpg' width=\"550\"\u003e\n\u003c/div\u003e\n\n# weapp-start\n\n[![NPM version](https://img.shields.io/npm/v/weapp-start.svg?style=flat)](https://npmjs.org/package/weapp-start)\n[![Build Status](https://travis-ci.org/tolerance-go/weapp-start.svg?branch=master)](https://travis-ci.org/tolerance-go/weapp-start)\n[![NPM downloads](http://img.shields.io/npm/dm/weapp-start.svg?style=flat)](https://npmjs.org/package/weapp-start)\n[![Dependencies Status](https://david-dm.org/tolerance-go/weapp-start/status.svg)](https://david-dm.org/tolerance-go/weapp-start)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\n选择 weapp-start 进行开发的主要理由之一就是**一切扩展功能全部组件化，可以随意组合，打造合适自己的开发环境**\n\n配合状态管理工具 [weappx](https://github.com/tolerance-go/weappx)，再复杂的小程序也可以轻松应\n\n\u003e 小程序早已原生支持组件化开发，体验下来老牌组件化框架在升级过程中非常不顺利，所以选择使用原生语法进行开发，但是同时有很多非常棒的特性，我希望能保留下来，因此有了这个项目\n\n# Why\n\n- 如果你只是开发一款好用的 小程序，单纯使用 小程序官方文档和规范，我建议你可以尝试本项目，它对于原生小程序开发体验有非常棒的提升\n\n- 如果你熟悉 vue，并且打算使用它们来兼容小程序的开发，那么我推荐你可以尝试 [wepy](https://github.com/Tencent/wepy) 或者 [mpvue](https://github.com/Meituan-Dianping/mpvue)，它们也都超赞\n\n- 如果你熟悉 react，并且准备一处编写，多端适配，那么我推荐你使用 [taro](https://github.com/NervJS/taro)\n\n# Features\n\n* 支持 [npm](https://www.npmjs.com/) 包引入\n* 支持 promise, async/await 等最新语法\n* 支持多种编译器，如 pug/less/stylus\n* 支持 ESlint\n* 支持本地 [mock](https://github.com/tolerance-go/weapp-start/blob/master/docs/mock.md) 数据\n* 支持一键生成项目，组件模版\n* 支持发布前资源压缩\n* 支持自定义插件\n* 多种工具，加速开发\n\n# Install\n\n```bash\nnpm i weapp-start -g\n```\n\n查看帮助\n\n```bash\nweapp-start -h\n```\n\n```bash\nweapp-start \u003ccommand\u003e [options]\n\n命令：\n  weapp-start dev    watch build\n  weapp-start build  打包构建\n  weapp-start init   生成模版项目\n  weapp-start new    生成模板页面\n  weapp-start mock   启动本地mock服务\n\n选项：\n  -h, --help     显示帮助信息                                             [布尔]\n  -v, --version  显示版本号                                               [布尔]\n```\n\n生成开发模版（项目模板都存放在[这里](https://github.com/tolerance-go/weapp-start-templates)，欢迎小伙伴 pr）\n\n```bash\nweapp-start init\n```\n\n进入生成目录，安装依赖\n\n```bash\nnpm i\n```\n\n启动实时编译\n\n```bash\nweapp-start dev\n```\n\n使用微信开发者工具新建项目，项目目录选择刚刚生成的文件夹，会自动导入项目配置\n\n# Tips\n\n- `weapp-plugin-require` 是基于 `commonJS` 模块规范的静态处理，也就是说 `es6` 模块定义的话，需要配合 `weapp-plugin-babel` 插件使用，\n`weapp-plugin-babel` 的顺序要在它之前。\n\n- 小程序里面对于 `require('common.js')` 是当做相对路径的，而在 node 中是作为模块查找的，因此应该避免这种隐式的相对路径写法，应该用 `require('./common.js')` 代替；`weapp-plugin-require` 对二者做了兼容，不过会发出提示信息要求修改路径\n\n- `weapp-plugin-jsmin` 只能对 es5 规范的代码进行压缩，将其顺序至于 `weapp-plugin-babel` 之后\n\n- 所有压缩功能的插件，如果想对生成的额外文件进行处理，需要指定参数 `extra` 为 `true`\n\n- 因为小程序的特有运行环境，在兼容外部 npm 包，比如 lodash 的时候，需要做一些 hack 操作，替换文本，但是它们更新太频繁了，精力不够，所以请在主项目锁死版本 lodash 版本号 `\"lodash\": \"4.17.5\"`\n\n# Plugins\n\n自定义插件文档 coming...\n\n* [weapp-plugin-babel](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-babel) - 集成 [babel](https://github.com/babel/babel)，可以使用最新的 js 语法，而不必担心兼容\n* [weapp-plugin-eslint](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-eslint) - 集成 [eslint](https://github.com/eslint/eslint)，自动检测代码规范\n* [weapp-plugin-less](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-less) - 集成 [less](https://github.com/less/less.js)，使用 less 语法编写 wxss\n* [weapp-plugin-pug](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-pug) - 集成 [pug](https://github.com/pugjs/pug)，使用 pug 语法编写 wxml\n* [weapp-plugin-require](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-require) - 分析依赖，导入第三方 npm\n* [weapp-plugin-stylus](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-stylus) - 集成 [stylus](https://github.com/stylus/stylus)，使用 stylus 语法编写 wxss\n* [weapp-plugin-filter](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-filter) - 过滤文件\n* [weapp-plugin-jsmin](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-jsmin) - 压缩 js\n* [weapp-plugin-filemin](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-filemin) - 压缩 xml，json，css\n* [weapp-plugin-imgmin](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-imgmin) - 压缩图片\n* [weapp-plugin-postcss](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-postcss) - 集成 [postcss](https://github.com/postcss/postcss)，可以使用最新的 css 语法和特效，而不必担心兼容\n* [weapp-plugin-replace](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-plugin-replace) - 文本替换\n* ...\n\n# Utils\n\n* [weapp-util-create-plugin](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-util-create-plugin) - 创建插件的工具方法\n* [weapp-util-requestfix-promisify](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-util-requestfix-promisify) - 原生小程序所有api进行promise化；优化并发请求数量\n* [weapp-util-watch-computed](https://github.com/tolerance-go/weapp-start/tree/master/packages/weapp-util-watch-computed) - 使原生小程序支持 watch，computed 属性\n* ...\n\n# Links\n\n* [Contribution](https://github.com/tolerance-go/blog/issues/1#issue-313932480)\n* Updatelog - 查看`packages/xxx/CHANGELOG.md`\n\n# Cases\n\n\u003cdiv align=left\u003e\n\u003cimage src='./assets/hqjy.jpg' width=\"290\"/\u003e\n\u003cimage src='./assets/nhwc.jpg' width=\"290\"/\u003e\n\u003c/div\u003e\n\n# License\n\n[MIT](https://tldrlegal.com/license/mit-license)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolerance-go%2Fweapp-start","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftolerance-go%2Fweapp-start","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolerance-go%2Fweapp-start/lists"}