You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
736 B
23 lines
736 B
const WebpackAliyunOss = require('webpack-aliyun-oss')
|
|
const args = process.argv.slice(2) || []
|
|
const ifProd = args[0] === 'prod'
|
|
|
|
new WebpackAliyunOss({
|
|
from: ['./dist/**'],
|
|
dist: '/',
|
|
overwrite: true,
|
|
region: 'oss-cn-guangzhou',
|
|
accessKeyId: ifProd ? 'LTAI5tK6dDnADdj1mgS6X9oa' : 'LTAINmC91NqIGN38',
|
|
accessKeySecret: ifProd ? 'fxg0tBxHj9gCGikaDXUmWj8pC9IrVu' : 'Hh10dQPjq1jMLLSpbDAR05ZzR3nXsU',
|
|
bucket: `dating-clue-opr${ifProd ? '-prod' : '-test'}`,
|
|
setOssPath(filePath) {
|
|
let index = filePath.lastIndexOf('dist')
|
|
let Path = filePath.substring(index + 4, filePath.length)
|
|
return Path.replace(/\\/g, '/')
|
|
},
|
|
setHeaders() {
|
|
return {
|
|
//'Cache-Control': 'max-age=31536000'
|
|
}
|
|
},
|
|
}).apply()
|