Git Product home page Git Product logo

wxmp-workflow-template's Introduction

wxmp-workflow-template

基于Gulp构建的微信原生小程序的开发工作流

特性

  • 基于gulp+less构建的微信小程序工程项目
  • 项目图片自动压缩
  • ESLint代码检查
  • 使用命令行快速创建pagetemplatecomponent
  • font 字体文件转换成base64

项目声明

该项目代码来源于 https://github.com/YangQiGitHub/wx-miniprogram-boilerplate 。因不够满足开发需求,所以个人对代码添加一些开发功能,以及修复原代码一些坑。

添加修复

  • /dist/ 小程序npm构建支持
  • font 字体文件转换成base64
  • 修复 gulp auto 生成模板的文件路径问题

Getting Started

0. 开始之前,请确保已经安装node和npm,全局安装gulp-cli
$ npm install --global gulp-cli
1. 下载代码
$ git clone https://github.com/AKA-BEN/wxmp-workflow-template.git
2. 进目录,安装依赖
$ cd wxmp-workflow-template && npm install
3. 编译代码,生成dist目录,使用开发者工具打开dist目录
$ npm run dev
4. 新建page、template或者component
  gulp auto -p mypage           创建名为mypage的page文件
  gulp auto -t mytpl            创建名为mytpl的template文件
  gulp auto -c mycomponent      创建名为mycomponent的component文件
  gulp auto -s index -p mypage  复制pages/index中的文件创建名称为mypage的页面
5. 上传代码前编译
$ npm run build
6. 上传代码,审核,发版

工程结构

wxmp-workflow-template
├── dist         // 编译后目录
│    ├── miniprogram_npm  // 小程序npm构建生成
│    ├── node_modules     // 小程序模块依赖
│    ├── package-lock.json
│    ├── package.json
├── node_modules // 项目依赖
├── src 
│    ├── assets     // 资源文件
│    │    ├── fonts     // 字体源文件
│    │    ├── images    // 图片资源
│    ├── behaviors  // 公用behavior
│    ├── components // 微信小程序自定义组件
│    ├── images     // 页面中的图片和icon
│    ├── pages      // 小程序page文件
│    ├── styles     // ui框架,公共样式
│    ├── template   // 模板
│    ├── utils      // 公共js文件
│    ├── app.js
│    ├── app.json
│    ├── app.less
│    ├── project.config.json // 项目配置文件
│    └── api.config.js       // 项目api接口配置
├── .gitignore
├── .eslintrc.js
├── package-lock.json
├── package.json
└── README.md

wxmp-workflow-template's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.