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

vue-cli-plugin-ddtool

v0.3.1

Published

vue-cli-plugin dev-server tools & deploy script for complex env

Downloads

84

Readme

vue-cli-plugin-ddtool

NPM License status npm package NPM downloads

usage

# 安装包
npm install vue-cli-plugin-ddtool -D
# 启动本地开发
vue-cli-service dev --env=test341
# 发布开发服务器
vue-cli-service deploy --env=test341

cli

  Usage: vue-cli-service dev [options]

  Options:

    --env     环境设置和 platmap 的 key 对应(development service proxy address)
    --pages   多页模式下增量启动开发服务配置(development pages name --pages page1,page2,page3)
    --full    多页模式下强制使用全量,会启动所有的页面(do not use incremental development)

  Usage: vue-cli-service deploy [options]

  Options:

    --env     环境设置和 platmap 的 key 对应(deploy service key)
    --pages   多页模式下增量启动开发服务配置(deploy pages name page1,page2,page3)
    --full    多页模式下强制使用全量,会启动所有的页面(do not use incremental deploy)

ddtool.js 配置文件

示例配置:

// ddtool.js
module.exports = {
    platMap: {
        test341: {
            domain: 'http://test341.deveploment.com',
            ip: 'xxx.xxx.x.xx',
            username: 'xxx',
            password: 'xxxxxx',
            sshPort: 22,
            serverPath: '/home/test341',
        },
    },
    // 可选配置
    proxyConfig: (env: keyof platMap) => {
        // 通过 env 获取 proxy host 动态配置本地开发 api 代理
        // return webpack-dev-server-proxy-config;
    },
};
// vue.config.js
const { proxyConfig } = require('ddtool');

module.exports = {
    devServer: {
        proxy: proxyConfig(process.env.NODE_ENV),
    },
};

platMap: 正常我们开发时的开发服务器代理配置 map,可以配置代理域名,用于启动开发代理,还可以配置测试服务器的IP地址ssh (端口默认为 22)、发布地址 serverPath。

proxyConfig: 返回一个 webpack-dev-serverproxy config 对象,也可以返回一个返回对象的函数。

Options

// ddtool.js

// 多页应用配置
module.exports = {
    multiPage: true,
    pages: glob = './src/module/*',
    // 页面入口 相对pages路径
    pagesEntry: glob = './main.js',
    // 页面模板 相对pages路径
    pagesTemplate: glob = './index.{pug,html}',
    // git主分支 用于增量更新,默认会自动根据git diff 启动增量服务
    mainBranch: string = 'master',
};

🔗 Links