npm install --save-dev 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
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'
}
}
]
}
]
}
}
Name | Type | Default | Description |
---|---|---|---|
accessKey | {String} | undefined | required |
secretKey | {String} | undefined | required |
bucket | {String} | undefined | required |
domain | {String} | undefined | required |