Commit 617647a9 authored by 张冬's avatar 张冬

2

parent 214d6a9b
...@@ -46,28 +46,28 @@ module.exports = { ...@@ -46,28 +46,28 @@ module.exports = {
}), }),
new InsertScriptPlugin({ files: modules }) new InsertScriptPlugin({ files: modules })
] ]
<!-- const webpackAliyunOss = [ // const webpackAliyunOss = [
new WebpackAliyunOss({ // new WebpackAliyunOss({
// from: './dist/**', // 上传那个文件或文件夹 可以是字符串或数组 // // from: './dist/**', // 上传那个文件或文件夹 可以是字符串或数组
// dist: 'web_admin/', // 需要上传到oss上的给定文件目录 // // dist: 'web_admin/', // 需要上传到oss上的给定文件目录
// region: 'oss-cn-shenzhen', // // region: 'oss-cn-shenzhen',
// bucket: 'ppy-prod-webadmin', // // bucket: 'ppy-prod-webadmin',
// test: true, // // test: true,
setOssPath: (filePath) => { // setOssPath: (filePath) => {
// some operations to filePath // // some operations to filePath
const index = filePath.lastIndexOf('dist') // const index = filePath.lastIndexOf('dist')
const Path = filePath.substring(index + 4, filePath.length) // const Path = filePath.substring(index + 4, filePath.length)
return Path.replace(/\/g, '/') // return Path.replace(/\/g, '/')
}, // },
setHeaders: (filePath) => { // setHeaders: (filePath) => {
// some operations to filePath // // some operations to filePath
// return false to use default header // // return false to use default header
return { // return {
'Cache-Control': 'max-age=31536000' // 'Cache-Control': 'max-age=31536000'
} // }
} // }
}) // })
] --> // ]
if (NODE_ENV === 'production') { if (NODE_ENV === 'production') {
config.plugins = [...webpackAliyunOss, ...config.plugins] config.plugins = [...webpackAliyunOss, ...config.plugins]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment