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

rollup-plugin-automatic-deployment

v1.0.1

Published

rollup自动化部署插件

Downloads

8

Readme

vite-plugin-auto-deploy

rollup把代码打包后自动布署到服务器中 npm run build 时才会打包上传布署

Installation 安装

npm install rollup-plugin-automatic-deployment --save-dev
# OR
yarn add rollup-plugin-automatic-deployment --dev
# OR
pnpm add rollup-plugin-automatic-deployment --save-dev

Usage 使用

This plugin will delete the files on the server for you and upload the packaged files to the server. Just add the plugin to your rollup/vite config as follows: 该插件将为您把服务器上的文件删除,并把打包后的文件上传到服务器中,只需要您将插件添加到 rollup/vite 配置中,如下所示:

rollup.config.ts

import {autoDeployPlugin} from 'rollup-plugin-automatic-deployment'

export default {
  plugins: [
    autoDeployPlugin(Options)
  ]
}

vite.config.ts

import autoDeployPlugin from 'vite-plugin-auto-deploy'

export default defineConfig({
  build:{
    rollupOptions:{
      plugins: [
        autoDeployPlugin(Options)
      ]
    }
  }
})

Options 配置

You can pass a hash of configuration options to vite-plugin-auto-deploy. Allowed values are as follows: 您可以将配置的选项传递给 vite-plugin-auto-deploy 插件。允许的值如下:

|Name键名|Explain说明|Type类型|Description描述| |:--:|:--:|:--:|:----------| |host|ServerIP/服务器IP|{string}|example/例: 123.123.123.124| |port|ServerPort/服务器端口|{number}|default: 22| |username|ServerUsers/服务器用户名|{string}|example/例: root| |password|ServerPassword/服务器密码|{string}|example/例: ****| |remotePath|ProjectPath/项目路径|{string}|example/例: /root/www/project_demo|

Here's an example rollup/vite config illustrating how to use these options 下面是一个示例 rollup/vite 配置,说明如何使用这些选项

rollup.config.ts

import {autoDeployPlugin} from 'rollup-plugin-automatic-deployment'

export default {
  plugins: [
    autoDeployPlugin({
      host: 'your server ip',
      username: 'your server users',
      password: 'your server password',
      remotePath: 'your project path on the server '
    })
  ]
}

vite.config.ts

export default defineConfig({
  build:{
    rollupOptions:{
      plugins:[
        autoDeployPlugin({
          host: 'your server ip',
          username: 'your server users',
          password: 'your server password',
          remotePath: 'your project path on the server '
        }),
      ]
    }
  }
})

🔥 After configuration, run the npm run build command to automatically upload and deploy the code to the server after packaging 💪 配置好后,运行 npm run build 命令即可实现代码打包后自动上传部署至服务器

⚠️ Attention:

  • 1.The code in the project requires npm run build packaging to take effect, otherwise the plugin will not take effect
  • 2.The project path on the server needs to be specified to the project folder, as the folder will be deleted before each upload

⚠️ 特别注意:

  • 1.项目中代码需要npm run build打包才会生效,否则插件不会生效
  • 2.服务器上的项目路径要指定到项目文件夹,因为每次上传前会先删除文件夹