npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

weapp-gulp-service

v1.0.12

Published

微信小程序预编译工作流 & weapp precompile workflow

Downloads

7

Readme

简介

weapp-gulp-service 是一款基于 gulp 实现的微信小程序预编译开发工具,可以有效提升原生小程序的开发效率。主要功能如下所示:

语法增强:

  1. 支持 less;
  2. 支持 px 自动转 rpx;
  3. 支持本地图片转 base64;
  4. 支持路径别名 alias;
  5. 支持设置环境变量(类似 vue-cli 的 .env 文件);
  6. 支持 json5 语法;
  7. 扩展 app.json,支持表达力更好的路由写法;
  8. 支持.vue 单文件开发(兼容大部分 v-指令);

工具特性:

  1. 0 配置使用;
  2. 支持增量编译;
  3. 支持自定义 task;
  4. 支持插件扩展(类似 Vue.use);
  5. 支持自动构建 npm(需开启 wxDevtool cli 服务);
  6. 支持命令行上传代码(需集成 miniprogram-ci);

安装/运行

全局安装并使用:

npm i weapp-gulp-service -g
# 项目根目录执行
wgs --config /user/workspace/xx/weapp.config.js

也可以局部安装并使用:

npm i weapp-gulp-service -D
# 项目根目录执行
npx wgs

项目 Demo 参见 weapp-project (可直接作为开发模版)。

详细说明

docs 目录。

Command API

开发模式:

# 编译 + watch
wgs [options]
# 或者
wgs serve [options]

打包模式:

# 仅编译
wgs build [options]

构建 npm

# 生成 miniprogram_npm 目录
wgs build:npm [options]

代码上传:

# 先编译再上传
wgs upload -v 1.0.1 [desc]

ps: 各命令选项可通过 --help 查看

小程序 ci/cli 集成说明

自动构建 npm上传代码两个功能前置依赖小程序官方服务——wxdevtool-cli 或者 miniprogram-ci

如果使用 wxdevtool-cli(以下简称 cli 模式),需设置环境变量:

# macOS
WX_CLI=<安装路径>/Contents/MacOS/cli
# Windows
WX_CLI=<安装路径>/cli.bat

如果使用 miniprogram-ci(以下简称 ci 模式),需设置环境变量:

WE_APP_PRIVATE_KEY_PATH=<私匙路径>/private.xxxx.key

并安装全局依赖 miniprogram-ci;

npm i miniprogram-ci -g

两种方式二选一即可。如果二者同时设置,则 ci 模式优先。