{"id":25613481,"url":"https://github.com/kszitt/hsuc","last_synced_at":"2025-04-13T19:13:23.819Z","repository":{"id":57267206,"uuid":"255217978","full_name":"kszitt/hsuc","owner":"kszitt","description":"Package files and upload them to the cloud to improve the loading speed","archived":false,"fork":false,"pushed_at":"2020-04-22T07:46:44.000Z","size":28,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T09:52:09.704Z","etag":null,"topics":["aliyun","cdn","cloud","huawei","huaweicloud","obs","oss","qiniu","upyun","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kszitt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-13T03:00:30.000Z","updated_at":"2023-11-27T06:26:17.000Z","dependencies_parsed_at":"2022-08-31T22:00:27.271Z","dependency_job_id":null,"html_url":"https://github.com/kszitt/hsuc","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/kszitt%2Fhsuc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kszitt%2Fhsuc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kszitt%2Fhsuc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kszitt%2Fhsuc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kszitt","download_url":"https://codeload.github.com/kszitt/hsuc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766746,"owners_count":21158301,"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":["aliyun","cdn","cloud","huawei","huaweicloud","obs","oss","qiniu","upyun","webpack"],"created_at":"2025-02-22T01:31:39.547Z","updated_at":"2025-04-13T19:13:23.791Z","avatar_url":"https://github.com/kszitt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 语言\n[中文](https://github.com/kszitt/hsuc/blob/master/README_ZH.md)\n\n## describe\nUpload the files generated by web pack to the cloud to improve the loading speed  \nCurrently, Alibaba cloud, Huawei cloud, Tencent cloud, qiniu cloud and remake cloud, as well as user-defined extensions are supported.\n\n## install\n```bash\nnpm install hsuc --save-dev\n```\n\n## required\n### Node\nNode.js \u003e= 10.10.0 required\n\n## use\n#### webpack.config.js\n```bash\n// webpack.config.js\nconst Hsuc = require('hsuc');\n\n...\nplugins: [\n    ...\n    new Hsuc({\n        cloudFolder: \"\u003cCloud folder\u003e\",\n        domain: \"\u003cdomain name\u003e\",\n        enable: true,\n        // Alicloud (Choose one)\n        aliyun: {\n            region: \"\u003cOSS region\u003e\",\n            accessKeyId: \"\u003cYour accessKeyId\u003e\",\n            accessKeySecret: \"\u003cYour accessKeySecret\u003e\",\n            bucket: \"\u003cYour bucket name\u003e\"\n        }\n        // Hua Weiyun (Choose one)\n        huawei: {\n            accessKeyId: \"\u003cProvide your Access Key\u003e\",\n            secretAccessKey: \"\u003cProvide your Secret Key\u003e\",\n            server: \"\u003chttps://your-endpoint\u003e\",\n            bucket: \"\u003cBucket\u003e\"\n        },\n        // Tencent cloud (Choose one)\n        tencent: {\n            secretId: \"\u003cSecretId\u003e\",\n            secretKey: \"\u003cSecretKey\u003e\",\n            bucket: \"\u003cBucket\u003e\",\n            region: \"\u003cRegion\u003e\"\n        },\n        // Qiniu cloud (Choose one)\n        qiniu: {\n            accessKey: \"\u003cACCESS_KEY\u003e\",\n            secretKey: \"\u003cSECRET_KEY\u003e\",\n            bucket: \"\u003cBucket\u003e\"\n        },\n        // Clapping clouds again (Choose one)\n        upyun: {\n            serviceName: \"\u003cservice name\u003e\",\n            operatorName: \"\u003coperator name\u003e\",\n            operatorPassword: \"\u003coperator password\u003e\",\n        }\n    })\n]\n```\n\n## hsuc(options) supported options\n- `aliyun` - Initialize alicloud OSS parameters\n- `huawei` - Initialize Huawei cloud OBS parameters.\n- `tencent` - Initialize Tencent cloud cos parameters.\n- `qiniu` - Initialize the Qiniu cloud parameter.\n- `upyun` - Initialize the re shooting cloud parameter.\n- `enable[boolean]` - Enable at the beginning, default`true`。\n- `removePrevVersion[boolean]` - Delete previous versions of cloud or not, default`false`\n- `log[boolean]` - Display log, default`true`\n- `cover[boolean|RegExp]` - Overwrite file, default`false`. Please refer to`/\\.(png|jpe?g|gif|ico|woff2?|svg|ttf|eot)$/`。\n- `custom[js文件，例如require(\"./template.js\")]` - User defined upload file, you can refer to the `template.js` in the project\n\n\n## Object store CORS rule settings\n- `aliyun` Set according to [CORS](https://help.aliyun.com/document_detail/44570.html?spm=5176.8465980.0.0.12871450vh6n2z)\n- `huawei` Set according to [CORS](https://support.huaweicloud.com/sdk-browserjs-devg-obs/obs_24_0201.html)\n- `tencent` Set according to [CORS](https://cloud.tencent.com/document/product/436/13318)\n- `qiniu` Set according to [CORS](https://console.upyun.com/services/kszitt/antileechFile/)\n- `upyun` Set according to [CORS](http://docs.upyun.com/cdn/feature/#cors)\n\n## matters needing attention\n- Please set the cloud access to \"public read / write\" or \"public read\"\n- In the options parameter, `aliyun`, `huawei`, `tencent`, `qiniu` and `upyun` are configured at the same time, only the first one is valid\n- The plug-in is disabled in development mode\n- `options.deletePrevBuildFile` Enabling this item will delete the previous version. Please be careful.\n\n#### deploy\n``` hash\nwebpack\n// Deploy the index.html file under the package folder to the server, and you can access\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkszitt%2Fhsuc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkszitt%2Fhsuc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkszitt%2Fhsuc/lists"}