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

mpvue-packager

v0.2.3

Published

mpvue 集成构建工具

Downloads

11

Readme

mpvue-packager

mpvue 集成构建工具

Quickstart

vue init F-loat/mpvue-packager my-project

安装

npm i -D mpvue-packager

npm i -D mpvue-packager-mp-plugin
npm i -D mpvue-packager-h5-plugin

使用

{
  "scripts": {
    "dev": "mpvue dev",
    "build": "mpvue build",
    "dev:h5": "mpvue dev --mode h5",
    "build:h5": "mpvue build --mode h5",
  }
}

配置

  • 打包配置

通过 -c--config 指定自定义 webpack 配置文件,默认为 packager.config.js

  • 打包模式

通过 -m--mode 指定打包模式,可选值 ['mp', 'h5'], 默认为 mp,即小程序平台打包

  • 输出路径

通过 -o--output 指定输出路径,默认为 dist

  • 监听端口

通过 -p--port 指定监听端口,默认为 8080

  • 目标平台

通过 -t--target 指定目标平台,可选值 ['wx', 'swan'], 默认为 wx

  • 代码分析

通过 --analyze 指定启用分析插件,生产模式下有效,默认为 false

  • 自动打开

通过 --open 指定自动打开浏览器,默认为 false

Tips

  • 可通过 process.env.NODE_ENV 判断当前构建环境,可选值 ['production', 'development']

  • 可通过 process.env.MODE 判断当前构建模式,可选值 ['mp', 'h5']

  • 自定义配置支持 ['object', 'function'] 两种形式,object 类型会与默认配置做合并处理,function 类型的入参为现有配置,需返回修改后的配置

  • 可通过 package.json 的 packagerOptions 属性对内部 config 进行覆盖

Change log

  • v0.2.3

    • [fix] 浏览器自动打开指令
    • [feat] 调整默认自定义配置文件
  • v0.2.2

    • [fix] 外部配置读取
    • [feat] 整合 lint 依赖
    • [feat] 优化 loader 顺序
  • v0.2.1

    • [fix] 文件发布规则
  • v0.2.0

    • [feat] 分离不同平台配置
    • [feat] 支持通过 package.json 覆盖配置
  • v0.1.8

    • [fix] 生产环境打包配置
    • [feat] 更新 mpvue-entry
  • v0.1.5

    • [feat] 新增打包进度显示
    • [feat] 新增监听端口、代码分析等配置
    • [feat] 新增多平台兼容支持
    • [feat] 增强自定义配置能力
  • v0.1.4

    • [feat] 注入环境变量 process.env.NODE_ENVprocess.env.MODE
    • [feat] 新增输出路径配置项
    • [refactor] 统一配置文件
    • [fix] 修正 h5 热更新配置
  • v0.1.3

    • [fix] 修正 vue-loader 配置
    • [fix] 修正小程序输出路径配置
  • v0.1.2

    • [feat] 新增 h5 打包配置
  • v0.1.1

    • [feat] 支持小程序打包

示例项目