All Projects → ksky521 → Gulp Wxapp Boilerplate

ksky521 / Gulp Wxapp Boilerplate

Licence: mit
小程序 Gulp 开发脚手架

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gulp Wxapp Boilerplate

wxbizdatacrypt
微信小程序加密数据解密算法Go版
Stars: ✭ 132 (-8.97%)
Mutual labels:  weapp, wechat-mini-program
Wxapp Boilerplate
使用 webpack, babel, scss 开发的微信/支付宝小程序项目脚手架
Stars: ✭ 367 (+153.1%)
Mutual labels:  wechat-mini-program, weapp
Eweapp
eweapp:ECShop非官方版微信小程序商城
Stars: ✭ 257 (+77.24%)
Mutual labels:  wechat-mini-program, weapp
mini-programm-template
基于原生微信小程序的一般般好用的模板
Stars: ✭ 35 (-75.86%)
Mutual labels:  weapp, wechat-mini-program
Tina
💃 一款轻巧的渐进式微信小程序框架
Stars: ✭ 1,153 (+695.17%)
Mutual labels:  wechat-mini-program, weapp
gulp-sass-bootstrap-boilerplate
⏰📌 Boilerplate with gulp.js, Sass, Babel, and Browsersync.
Stars: ✭ 24 (-83.45%)
Mutual labels:  gulp, boilerplate-template
Wafer2 Node Sdk
Wafer2 SDK for Node.js
Stars: ✭ 270 (+86.21%)
Mutual labels:  tencent, weapp
We Validator
💯 简单灵活的表单验证插件,支持小程序、浏览器以及Nodejs端使用
Stars: ✭ 180 (+24.14%)
Mutual labels:  wechat-mini-program, weapp
Nideadmin
【未完成】NideAdmin - 基于 Vue.js + Egg.js 的微信小程序后台框架
Stars: ✭ 35 (-75.86%)
Mutual labels:  wechat-mini-program, weapp
Alaweb
一套 Vue 代码,多端可用(H5、小程序、苹果App、安卓App、头条等)。系统含150+页面,200+组件(5端通用),30+元件(每个终端独立完成)
Stars: ✭ 837 (+477.24%)
Mutual labels:  wechat-mini-program, weapp
frontenso-11ty-starter
Production-ready 11ty+Gulp+Webpack Starter that features Nunjucks, SASS, TailwindCSS (with JIT complier), and ESNext.
Stars: ✭ 24 (-83.45%)
Mutual labels:  gulp, boilerplate-template
Weapp Qrcode
weapp.qrcode.js 在 微信小程序 中,快速生成二维码
Stars: ✭ 1,194 (+723.45%)
Mutual labels:  wechat-mini-program, weapp
Wechat web devtools
微信开发者工具(微信小程序)linux完美支持
Stars: ✭ 2,664 (+1737.24%)
Mutual labels:  wechat-mini-program, weapp
miniprogram-picker
微信小程序自定义组件Picker。本组件对微信小程序原生Picker组件进行了二次封装,开发者只需要提供固定数据结构的sourceData,再进行一些必要配置,本组件就可以自动帮助开发者处理联动逻辑。
Stars: ✭ 30 (-79.31%)
Mutual labels:  weapp, wechat-mini-program
Wxapp Webpack Plugin
📦 微信小程序 webpack 插件
Stars: ✭ 185 (+27.59%)
Mutual labels:  wechat-mini-program, weapp
Extension Boilerplate
⚡️ A template for building cross browser extensions for Chrome, Opera & Firefox.
Stars: ✭ 2,958 (+1940%)
Mutual labels:  gulp, boilerplate-template
Weapp Workflow
基于Gulp 的微信小程序前端开发工作流 💯
Stars: ✭ 241 (+66.21%)
Mutual labels:  gulp, weapp
Weapp Jump
跳一跳 小程序 源码
Stars: ✭ 173 (+19.31%)
Mutual labels:  wechat-mini-program, weapp
Masterwechatapp
『微信小程序』优秀教程、轮子、开源项目 资源汇总
Stars: ✭ 826 (+469.66%)
Mutual labels:  wechat-mini-program, weapp
Nfu Guide Map
📍 地图导览小程序 — 南苑导览 🚶 仅需修改配置即可适配任意场景的个性化定制地图小程序
Stars: ✭ 72 (-50.34%)
Mutual labels:  wechat-mini-program, gulp

小程序 Gulp 开发脚手架

  • sass 开发 wxss
  • webfont 自动 base64 引入
  • 支持 px2rpx
  • es6/7 开发 js
  • 支持生产环境打包
  • 支持小程序云
  • 支持小程序云函数、存储 mock
  • 支持 watch 功能

配置

  • config.server.json 是 mock server 的配置

目录结构

├── README.md
├── client            // 小程序 client 部分,主要编写内容
│   ├── app.js
│   ├── app.json
│   ├── app.scss
│   ├── project.config.json  // 小程序项目配置,比如:云函数文件夹
│   ├── components   // 组件
│   ├── images       // 图片资源
│   ├── lib
│   │   ├── api-mock.js   // api-mock 功能,详见文档「云函数 mock」部分
│   │   ├── api.js       // 实际 api
│   │   ├── bluebird.js
│   │   └── util.js
│   └── pages
│       └── index
├── config.server.json
├── dist
├── gulpfile.js
├── package.json
├── server           // 小程序 server 部分,主要是静态资源和云函数
│   ├── cloud-functions
│   │   ├── test
│   │   └── test2
│   ├── index.js
│   ├── inline    // 云函数公共模块,打包的时候会 inline 进引入的云函数
│   │   └── utils.js
│   └── static
│       └── gulp.png
└── test         // 测试文件夹
    └── functions  // 存储小程序云测试用的参数模板
        └── test.json

使用

  1. git clone 之后,进入文件夹,执行npm i安装依赖
  2. 使用方法如下:
# 启动 gulp 编译 client 文件夹
npm run dev
# 启动 server,有nodemon,修改文件会自动重启
npm run server
# 上线打包
npm run build
# watch cloud functions 自动同步到 dist/cloud-functions

云函数 mock

小程序Serverless云的云函数功能很好用,解决了前端开发小程序后端服务的痛点,但是云函数每次修改都要上传部署到线上才能测试,的确是很费时费力,我这里使用了express 做了个 mock server,原理是:

  1. 将云函数代码拆分成单例
  2. server/index.js中,将云函数作为一个 express 的中间件函数使用
  3. 在本地开发中,小程序前端调用的云函数wx.cloud.callFunction的时候,替换成api-mock.js中的使用 wx.request 调用的本地 mock server 接口
  4. 使用 jdists 开发时候使用本地的 api-mock,生产打包则暴漏真正的api.js(详见:pages/index/index.js
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].