Skip to content

Upload file to qiniu and replace file to qiniu url

License

Notifications You must be signed in to change notification settings

moosoul/qiniu-loader

Repository files navigation

Qiniu Loader

Upload files to qiniu and Loads files as qiniu url

Install

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

Name Type Default Description
accessKey {String} undefined required
secretKey {String} undefined required
bucket {String} undefined required
domain {String} undefined required

About

Upload file to qiniu and replace file to qiniu url

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published