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

uni-packing-wgt

v1.0.2

Published

uni packing wgt

Downloads

29

Readme

介绍

由于官方的HBuilderX编译器打包wgt每次都要手动的操作有些繁琐,也不支持多环境打包,在开发阶段与原生项目交互调试是极其不方便。 而uni-packing-wgt正好可以解决这些问题。

uni-packing-wgt是uniapp跨平台多环境资源打包、调试、发布的命令行工具。

主要特性:

  • 支持同时构建多个环境资源(dev、beta、release)包,也包括了wgt包。
  • 支持上传发布到七牛云平台,其他云平台暂不支持,七牛刷新文件CDN缓存后续也会支持。
  • 在构建资源包时也可以同步内置到原生项目上,方便在开发阶段与原生间的交互调试。
  • 支持版本号自增,如果在原生项目上内置资源包调试,此时可用上,因为内置资源包调试版本号必须增加才会生效。

工具仅限于vite cli创建的项目使用,不支持HBuilderX创建的项目。

安装使用

安装:

npm i uni-packing-wgt

在使用打包命令build-wgt之前,必须先在package.json中配置uniapp的打包命令,如下:

"build:app-plus-dev": "uni build -p app-plus --mode development --outDir=./dist/dev/app",
"build:app-plus-beta": "uni build -p app-plus --mode beta --outDir=./dist/beta/app",
"build:app-plus-release": "uni build -p app-plus --mode production --outDir=./dist/release/app"

其中developmentbetaproduction是vite多环境配置的文件名。

打包命令build-wgt在初次执行时,会在项目根目录创建三个配置文件,可根据需求自由配置:

  • config.json
  • config-output.json
  • config-release.json

config.json

{
  "runDev": true, // 指定打包的环境
  "runBeta": false,
  "runRelease": false,
  "isIncrementVersion": true, // 版本是否自增
  "uploadWgtPackage": false, // wgt包是否上传到云平台上,需要结合upload参数使用
  "pkgCopyToNativeDir": false, // 是否将资源包同步到原生项目上,需要在config-output.json配置路径
  "upload": {
    "devAccessKey": "",
    "devSecretKey": "",
    "devBucket": "",
    "devDomainName": "",
    "devDir": "app"
  }

}

以dev环境为例,结果:

hzwei@HZWeis-Mac-mini uni-mall-staff % build-wgt

======开始生成资源包=====
======资源包生成完成=====
======资源包开始压缩=====
{ status: 'fulfilled', value: './dist/dev/__UNI__xxxx60.wgt' }
======资源包压缩任务完成=====
======资源包开始复制=====
{
  hash: 'Fop4lZ8NADlAsThMVWIiTjoTh_JT',
  key: 'app/dev/__UNI__xxxx60.wgt'
}
前往刷新url:  https://xxxx.com/app/dev/__UNI__xxxx60.wgt
======资源包上传完成=====