{"id":17677422,"url":"https://github.com/unadlib/ssh-webpack-plugin","last_synced_at":"2025-05-07T21:45:39.622Z","repository":{"id":45203053,"uuid":"71545979","full_name":"unadlib/ssh-webpack-plugin","owner":"unadlib","description":"Webpack SSH deployment plugin.","archived":false,"fork":false,"pushed_at":"2021-12-31T15:37:07.000Z","size":11,"stargazers_count":19,"open_issues_count":4,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T21:45:34.429Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unadlib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-21T08:30:56.000Z","updated_at":"2023-03-15T17:09:38.000Z","dependencies_parsed_at":"2022-07-25T23:49:28.732Z","dependency_job_id":null,"html_url":"https://github.com/unadlib/ssh-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unadlib%2Fssh-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unadlib%2Fssh-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unadlib%2Fssh-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unadlib%2Fssh-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unadlib","download_url":"https://codeload.github.com/unadlib/ssh-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252961858,"owners_count":21832192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-24T07:28:39.993Z","updated_at":"2025-05-07T21:45:39.602Z","avatar_url":"https://github.com/unadlib.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ssh-webpack-plugin\nWebpack SSH deployment plugin.\n\n-----\n\n\u003eThe Webpack plugin is based on ssh2 and scp2.\n\nThe webpack plugin helps developers quickly and automatically deploy project projects to the production server, support for ssh-privateKey login, and shell execution before and after the deployment of the command.\n\n## Install\n\nInstall the plugin with npm:\n```shell\nnpm install ssh-webpack-plugin --save-dev\n```\n## Usage\nJust add the plugin to your webpack config as follows:\n```\nvar SshWebpackPlugin = require('ssh-webpack-plugin');\nvar webpackConfig = {\n  entry: 'index.js',\n  output: {\n    path: 'build',\n    filename: 'app.js'\n  },\n  plugins: [new SshWebpackPlugin({\n        host: 'Remote host',\n        port: 'Remote port',\n        username: 'Remote username',\n        password: 'Remote password',//or use privateKey login(privateKey: require('fs').readFileSync('/path/to/private/key')).\n        from: 'Deploy Local path',\n        to: 'Remote full path',//important: If the 'cover' of value is false,All files in this folder will be cleared before starting deployment.\n  })]\n};\n```\n\n### Options\n\n#### host\nType: `String`\n\u003eThe host of the remote server.\n\n#### port\nType: `String`\nDefault value: `'22'`\n\u003ePort to connect to on the remote server.\n\n#### username\nType: `String`\n\u003eThe username to connect as on the remote server.\n\n#### password\nType: `String`\n\u003ePassword for the username on the remote server.\n\n#### to\nType: `String`\n\u003eFull path on the remote server where files will be deployed.\n\n#### from\nType: `String`\nDefault value: `'build'`\n\u003ePath on your local for the files you want to be deployed to the remote server. No trailing slash needed.\n\n#### cover\nType: `Boolean`\nDefault value: `true`\n**__[Important]__: If this value is false,all files in remote path folder will be cleared before starting deployment.**\n\u003eLocal Deployment files will be cover to deployment directory on remote path.\n\n#### privateKey\nType: `string`\n\u003ePath to your private key `privateKey: require('fs').readFileSync('/path/to/private/key')`\n\n#### passphrase\nType: `String`\n\u003ePassphrase of your private key if needed.\n\n#### before\nType: `String` or `Array`\n\u003eCommands to run on the server before and before deploy directory is created. \n\n#### after\nType: `String` or `Array`\n\u003eCommands to run on the server before and after deploy directory is created. \n\n#### readyTimeout\nType: `Number`\nDefault value: `20000`\n\u003eDefault timeout (in milliseconds) to wait for the SSH handshake to complete.\n\n#### zip\nType: `Boolean`\nDefault value: `true`\n\u003eCompress the build before uploading.\n\n#### max_buffer\nType: `Number`\nDefault value: `200 * 1024`\n\u003eLargest amount of data allowed on stdout or stderr.\n\n#### exclude\nType: `Array`\nDefault value: `[]`\n\u003eList of folders or files to exclude from build.\n\n### Usage Examples\nAdd setting in `webpack.config.js`:\n```\nplugins: [\n    new SshWebpackPlugin({\n        host: '10.211.55.5',\n        port: '22',\n        username: 'root',\n        privateKey: require('fs').readFileSync('/Users/unadlib/.ssh/id_rsa'),\n        before:'mkdir beforeTest',\n        after:'mkdir afterTest',\n        from: './build',\n        to: '/root/test',\n    })\n]\n```\n## Release History\n* 2016/10/22 - v0.1.7 - Add the 'cover' options.\n* 2016/10/22 - v0.1.4 - Initial Release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funadlib%2Fssh-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funadlib%2Fssh-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funadlib%2Fssh-webpack-plugin/lists"}