Skip to content
将webpack打包后的文件上传至七牛云
Branch: master
Clone or download
Pull request Compare This branch is 5 commits ahead, 2 commits behind gebilaoxiong:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Docs
lib
.gitignore
README.md
index.js
package.json

README.md

K-Qiniu

After the packaged webpack file upload to seven Qiniu

Install

npm:

  npm install  --save k-qiniu

Use

  1. Set webpack
  var QiniuPlugin = reqiure('k-qiniu');
    

  // Webpack 配置文件
  module.exports = {
    plugins: [
      new QiniuPlugin({

          // 七牛云的两对密匙 Access Key & Secret Key
          accessKey: 'accessKey',
        
          secretKey: 'secretKey',
        
          // 七牛云存储空间名称
          bucket: 'test',
          
          // 上传到七牛后保存的文件名
          // name is package.json name
          //version is package.json version
          //asset is file name
          path: 'static/[name]/[version]/[asset]'

        })
      // ...
    ]
    // ...
  };

  1. Set publicPath

publish

var package = require('./package')
const publicPath = 'http://publish.404mzk.com/static/' + package.name + "/" + package.version +"/"

module.exports = {
  ...
   output: {
    
    publicPath: publicPath,

  },
}
You can’t perform that action at this time.