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

h-vue-cli

v1.1.8

Published

h-vue-cli前端构建脚手架

Downloads

5

Readme

h-vue-cli前端构建脚手架

h-vue-cli是一个前端的脚手架工具,用于构建内部模板的工具,项目参考了tg-cli

主要功能有:

  • 初始化模版
  • 生成PC、移动端等cli中现有模板
  • 添加本地自定义模板
  • 管理cli的模板

安装

环境: Node.js , npm 3.0+、 Git.

npm install -g h-vue-cli

如安装过慢,推荐使用国内镜像安装 cnpm


生成模板

安装完成以后,可以在命令行下使用 h-vue-cli 命令来创建模板,该命令的用法:

$ h-vue-cli -h

    Usage: h-vue-cli <command>
  
  
    Options:
  
      -V, --version  output the version number
      -h, --help     output usage information
  
  
    Commands:
  
      add|a      Add a new h-vue fe template
      list|l     List all the dtit fe templates
      init|i     Generate a new dtit fe project
      delete|d   Delete a new dtit fe template

快捷生成需求模板,使用 h-vue-cli init 来实现

F:\Work\GitHub\h-vue-cli>h-vue-cli init
                                       
? 选择项目类型:  (Use arrow keys)
> DTiT-FE-Mobile
  DTiT-FE-Wechat
  DTiT-FE-Desktop-AdminLTE
  DTiT-FE-Desktop-ElementUI
? 选择项目类型:  DTiT-FE-Wechat
? 输入项目名(例: Dtit-xxx-xxx):  dtit-test
? 输入项目描述:  this is test project

 Start generating...

 √ Generation completed!

 cd dtit-test && npm install

后续说明(AdminLTE模板暂不支持)

  1. 用命令行进入项目开发目录
cd <新建的目录>
  1. 安装依赖项
npm install
  1. 启动项目
npm run dev

执行上述命令后,访问 http://localhost:8085
你对网页、样式、脚本、图片做的任何修改,一旦保存,浏览器会立即自动刷新当前页面。

开发说明

JavaScript Style Guide
使用内置模板,进行项目开发,应对以下内容略有了解

  • 拥有一定的前端基础
  • Vue (了解并掌握Vue基础使用)
  • ES6 (了解基本的import和export模块)
  • Node.js (了解简单构建命令使用即可)
  • Npm (了解依赖包的安装,卸载)
  • Webpack (了解webpack基础知识)
  • ESLint (内置模板使用了Standard规则,此规则为Vue默认规则)
    更多说明,参见内置模板详情

打包发布

页面制作完毕之后,可以进行打包操作:

  1. 生成 (npm run build)
F:\Work\NewSVN\A01.Dev-Application\element-h-vue-template>npm run build

> [email protected] build F:\Work\NewSVN\A01.Dev-Application\element-h-vue-template
> node build/build.js

npm WARN invalid config loglevel="notice"
| building for production...
Starting to optimize CSS...
Processing static/css/app.7866e1e63e59ad6ceac3dcebe7a684d6.css...
Processed static/css/app.7866e1e63e59ad6ceac3dcebe7a684d6.css, before: 168491, after: 166355, ratio: 98.73%
Hash: 68f3729e268294830a72
Version: webpack 2.7.0
Time: 32316ms
        Asset     Size  Chunks                    Chunk Names
         xxx   12.9 kB          [emitted]         
         xxx  13.2 kB          [emitted]         
         xxx  31.4 kB          [emitted]         
         xxx  67.6 kB          [emitted]         
         xxxx 1.05 kB          [emitted]         

  Build complete.

  Tip: built files are meant to be served over an HTTP server.
  Opening index.html over file:// won't work.

该命令使用了webpack构建工具进行项目的构建。

内置模板详情(目录说明,用法等,参照对应项目)

element-h-vue-template