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

syue-cli

v2.0.1

Published

基于webpack多页面打包工具

Downloads

197

Readme

syue-cli

基于webpack多页面打包工具

Install

npm install -g syue-cli

Usage

syue [options] [value ...]

syue init projectName [--cover] 
初始化一个项目,如果项目已经存在,可以添加--cover参数将其覆盖

项目目录
|-components 通用组件
|-pages 项目模块
    |-home 其中一个模块,模块必须有一个src目录
        |-src
|-test 测试
    |-unit 单元测试
|-sy.config.js/webpack.config.js sy配置文件


syue dev
在本地会持续编译并生成对应的文件,主要在联调时供后端人员访问
syue start
在本地会持续编译并打开浏览器,实现热加载和代理
syue build
上线发布
// syue.config.js配置文件详情
module.exports = {
 // 编译文件入口
 "files": {
   "pages/home/src/index.js": 1
 },
 // 对于node_modules下的js是否排除
 "exclude": true,

 /**  生产配置  **/
 // 提取js模块
 "vendor": true,
 // 生成文件的hash值,默认不生成
 "chunkhash": 8,
 // 是否提取css,默认不提取
 "extractCSS": true,
 // 是否生成source-map, 默认不生成
 "devtool": "#source-map",
 // 线上访问地址,默认//static.sunyur.com/项目目录
 "publicPath": "/",
 // 分析块之间的依赖
 "bundleAnalyzerReport": true,

 /**  开发配置  **/
 // 上下文,默认当前目录
 "context": __dirname,
 // 入口文件
 "index": "pages/home/index.html",
 // 静态资源目录,默认index的上级目录
 "staticPath": "./",
 // 端口默认8080
 "port": 8080,
 // 自动打开浏览器
 "autoOpenBrowser": true,
 // api
 "proxyTable": {
   '/api': {
     target: 'http://127.0.0.1:3000',
     changeOrigin: true
   }
 },
 // 添加mock,key:请求路径,value:文件地址
 "mockTable": {
    '/api': 'mocks/home.js'
 },
 
 /** 测试配置 */
 // 是否展示测试覆盖率,默认false
 coverage: true
} 

Commands

init [projectName]  初始化项目
dev                 开发
build               发布上线
start               开发自动启动服务
help [cmd]          display help for [cmd]

Options

-h, --help     output usage information
-V, --version  output the version number
-c, --cover    如果工程名存在,就覆盖掉
-r, --remove   build之前将dist目录删掉

其他

在测试时使用PhantomJS,但安装经常失败,在package.json依赖中去掉了, 需要手动安装vue-template-compiler和vue 经常失败的包,手动安装 sass-loader node-sass less less-loader