A static upload between the webpack plugin to the CDN (Ali Cloud OSS, Amazon S3, Qiniu Cloud Kodo)
npm install webpack-plugin-cdns
npm install webpack-plugin-cdns
`
$3
`
const WebpackPluginCdns = require('webpack-plugin-cdns')
`
$3
Ali Cloud OSS
`
plugins: [
...,
new WebpackPluginCdns({
from: ['./dist/*', '!.html'],
dist: '/directory/',
// Ali Cloud OSS (options: https://help.aliyun.com/document_detail/64097.html)
oss: {
accessKeyId: '',
accessKeySecret: '',
bucket: '',
region: '',
}
})
]
`
Amazon S3
`
plugins: [
...,
new WebpackPluginCdns({
from: ['./dist/*', '!.html'],
dist: '/directory/',
// Amazon S3
s3: {
accessKeyId: '',
secretAccessKey: '',
Bucket: '',
region: ''
}
})
]
`
Qiniu Cloud Kodo
`
plugins: [
...,
new WebpackPluginCdns({
from: ['./dist/*', '!.html'],
dist: '/directory/',
// 七牛云 Kodo
kodo: {
accessKey: '',
secretKey: '',
bucket: ''
}
})
]
``