GithubHelp home page GithubHelp logo

micoinsmith / wxapp-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cantonjs/wxapp-boilerplate

0.0 2.0 0.0 744 KB

使用 webpack, babel, scss 开发的微信/支付宝小程序项目脚手架

JavaScript 70.57% CSS 29.43%

wxapp-boilerplate's Introduction

wxapp-boilerplate

使用 webpack, babel, scss 开发的微信/支付宝小程序项目脚手架

webpack-dashboard

功能

  • 支持引用 node_modules 模块
  • 支持通过配置 alias 来避免 ../../../ 之类的模块引用
  • 通过 babel 支持更丰富的 ES6 兼容,包括 async/await
  • 内置 promiselodashlodash 按需引入相应模块,不会全部引入)
  • 使用 scss 编写 .wxss 文件,内置了一些有用的 mixinsextends
  • 提供 __DEV__process.env.NODE_ENV 全局常量辅助开发
  • 支持自动编译为微信和支付宝小程序
  • 提供 __WECHAT____ALIPAY__ 全局常量来判断是微信小程序或支付宝小程序
  • 通过命令行快速创建微信小程序页面
  • 支持在 production 环境下压缩代码

开始使用

确保安装了 Node.js (>= v4.2) 和 yarnnpm

  1. git clone 此项目
  2. 通过命令行工具 cd 到这个目录,执行 yarn 安装依赖模块
  3. 执行 yarn watch 开始开发
  4. 通过微信开发者工具,添加 dist/wechat 目录到项目上

内置命令

  • yarn watch 启动 webpack 开发微信小程序项目,能监听文件变化自动重新编译
  • yarn watch:alipay 启动 webpack 开发支付宝小程序项目,能监听文件变化自动重新编译
  • yarn build 编译生成 production 环境的代码到 dist/wechatdist/alipay
  • yarn lint:build 执行 yarn build 命令,并使用 eslint 和 stylelint 来校验代码规范
  • yarn prettier 执行 prettier 来格式化 src 目录下的代码
  • yarn create-page 快速创建微信小程序页面(更多 create-page 的用法,请查看 create-wxapp-page

兼容微信和支付宝小程序

开发者可以选择一套源代码来开发微信和支付宝小程序,这脚手架支持自动编译 wxmlaxml,转换 wx:attra:attr,转换 API wxmy,反之亦然。但个别接口在平台上也略有差异,开发者可以通过 __WECHAT____ALIPAY__ 来动态处理。

更新日志

Changelog

相关项目

License

MIT

wxapp-boilerplate's People

Contributors

cap32 avatar cytle avatar

Watchers

James Cloos avatar srilanka 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.