0.0.3 • Published 6 years ago

qiniu-loader v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago
npm install --save-dev qiniu-loader

qiniu-loader

Upload file to qiniu and replace file to qiniu url

  • Upload PNG
  • TEST
  • Support Other Static Resource
  • Work Togather With Other Webpack Loader
  • Documention

Usage

The qiniu-loader works like the url-loader but return the uploaded resource url on qiniu.

import img from './image.png'

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.(png|jpg|gif)$/,
        use: [
          {
            loader: 'qiniu-loader',
            options: {
              accessKey: 'qiniu AccessKey',
              secretKey: 'qiniu SecretKey',
              bucket: 'qiniu bucket name',
              domain: 'The default domain with your bucket'
            }
          }
        ]
      }
    ]
  }
}

Options

NameTypeDefaultDescription
accessKey{String}undefinedrequired
secretKey{String}undefinedrequired
bucket{String}undefinedrequired
domain{String}undefinedrequired
0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago