Home

Awesome

<div align="center"> <a href="https://cli.vuejs.org/"> <img width="200" height="200" src="https://cli.vuejs.org/favicon.png"> </a> <h1>Upload To qiniu cloud webpack|vue-cli-Plugin</h1> <h1>Qiniu Cloud scaffolding package upload plug-in package,webpack5,vue-cli4|vue-cli5 plugin</h1> <p>A plugin upload file to qiniu clound for vue-cli4|vue-cli5</p> <p align="center"> <img src="https://img.shields.io/npm/v/webpack-plugin-qiniu-upload?style=flat-square" alt="npm version" /> <img src="https://img.shields.io/npm/dm/webpack-plugin-qiniu-upload.svg?style=flat-square&color=#4fc08d" alt="downloads" /> </p> </div> <h2 align="center">Features</h2>

☁️ Support the latest SDK Qiniu Cloud upload, adapted to the latest VUE scaffolding CLI4.0 and 5.0 versions

💪 Suitable for the latest vue scaffolding cli4.0 and 5.0 versions, support webpack5 configuration

💪 Webpack5 configuration is supported

🚀 Incremental file upload is supported, eliminating the annoyance and waiting time of repeatedly uploading and refreshing files for all resources

<h2 align="center">Install</h2>
  pnpm add webpack-plugin-qiniu-upload -D
  yarn add webpack-plugin-qiniu-upload -D
<h2 align="center">Use the sample</h2>

vue.config.js

const UploadQiNiuPlugin = require("webpack-plugin-thirdparty-upload");
const isBuildDev = process.env.buildMode === 'dev'

module.exports = {
  ...,
  plugins: [
    uploadPlugin({
        sdkName: isBuildDev ? 'qiniu' : 'aws',
        accessKey: isBuildDev ? process.env.QN_ACCESS_KEY : process.env.AWS_ACCESS_KEY,
        secretKey: isBuildDev ? process.env.QN_SECRET_KEY : process.env.AWS_SECRET_KEY,
        bucket: isBuildDev ? process.env.QN_BUCKET : process.env.AWS_BUCKET,
        region: isBuildDev ? 'Zone_z2' : 'us-east-1',
        awsDistributionId: 'xxxx', // aws的失效id
        enabledRefresh: true,
        publicPath: process.env.logBaseUrl,
        uploadTarget: path.resolve(__dirname, './dist'),
        appName: webpackEntry.EntryConfigs[argv.e].filename.replaceAll('.html', ''),
        fileLogPath: 'log/',
        env: isBuildDev ? 'development' : 'production',
        htmlPath: htmlPath, // html 存到云的路径
        excludeHtml: false, // 是否排除html文件
        // suffix: '-v1'
    })
  ],
};
<h2 align="center">Options</h2>

qiniu cloud Options

NameTypeDefaultDescription
qiniuAccessKey{String}nullYour Qiniu AccessKey
qiniuSecretKey{String}nullYour Qiniu SecretKey
qiniuBucket{String}nullYour Qiniu Bucket Name
qiniuZone{String}nullYour Qiniu zone code
enabledRefresh{Boolean}falseIs enable refresh the file on Qiniu Clound after file upload
excludeHtml{Boolean}trueIs exclude html file
onlyRefreshHtml{Boolean}falseonly refresh html file (eg: _/demo/index.html + _/demo/), throws an exception in the case of a failure.
prefixPath{String}-prefix path for the file
fileLogPath{String}log/Provide a directory where log file should be stored
publicPath{String}webpackConfig.output.publicPathThe prefix path to your packaged resource
uploadTarget{String}webpackConfig.output.pathDirectory of the folder to be uploaded
appName{Number}Date.now()Optional. Name of the file used to generate resource mapping file logs
env{String}developmentThe environment directory corresponding to the JSON file of log

About qiniuZone:

TODO LIST