JSPM

frontend-deployer

1.1.2
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 14
    • Score
      100M100P100Q65317F
    • License MIT

    Deploy frontend projects to remote servers

    Package Exports

    • frontend-deployer
    • frontend-deployer/src/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (frontend-deployer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Frontend Deployer

    一个用于部署前端项目到远程服务器的命令行工具。

    安装

    npm install -g frontend-deployer

    使用方法

    初始化配置文件

    frontend-deployer init

    这将创建一个默认的配置文件 deploy.config.yaml。你也可以指定输出路径:

    frontend-deployer init -o custom.config.yaml

    部署项目

    使用配置文件部署

    frontend-deployer deploy -c deploy.config.yaml

    使用命令行参数部署

    frontend-deployer deploy -h <host> -P <port> -u <username> -p <password> -d <dist> -r <remote>

    参数说明:

    • -h, --host: 服务器地址(必需)
    • -P, --port: SSH端口(默认:22)
    • -u, --username: SSH用户名(必需)
    • -p, --password: SSH密码(必需)
    • -d, --dist: 本地构建目录(默认:dist)
    • -r, --remote: 远程部署目录(必需)
    • -c, --config: 配置文件路径

    配置文件格式

    # 服务器配置
    host: your-server.com
    port: 22
    username: your-username
    password: your-password
    
    # 部署配置
    dist: dist
    remote: /var/www/html

    示例

    1. 初始化配置文件:
    frontend-deployer init
    1. 编辑配置文件后部署:
    frontend-deployer deploy -c deploy.config.yaml
    1. 使用命令行参数部署:
    frontend-deployer deploy -h example.com -u root -p password -r /var/www/html

    注意事项

    1. 确保本地构建目录(dist)存在
    2. 确保远程目录有写入权限
    3. 建议使用配置文件来管理部署参数,避免在命令行中暴露敏感信息
    4. 初始化配置文件后,请仔细检查并修改所有配置项