Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-base
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张冬
web-base
Commits
617647a9
Commit
617647a9
authored
Sep 10, 2020
by
张冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2
parent
214d6a9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
vue.config.js
vue.config.js
+22
-22
No files found.
vue.config.js
View file @
617647a9
...
...
@@ -46,28 +46,28 @@ module.exports = {
}),
new
InsertScriptPlugin
({
files
:
modules
})
]
<!--
const
webpackAliyunOss
=
[
new
WebpackAliyunOss
({
// from: './dist/**', // 上传那个文件或文件夹 可以是字符串或数组
// dist: 'web_admin/', // 需要上传到oss上的给定文件目录
// region: 'oss-cn-shenzhen',
// bucket: 'ppy-prod-webadmin',
// test: true,
setOssPath
:
(
filePath
)
=>
{
// some operations to filePath
const
index
=
filePath
.
lastIndexOf
(
'dist'
)
const
Path
=
filePath
.
substring
(
index
+
4
,
filePath
.
length
)
return
Path
.
replace
(
/
\/
g, '/
')
},
setHeaders: (filePath) => {
// some operations to filePath
// return false to use default header
return {
'
Cache
-
Control
': '
max
-
age
=
31536000
'
}
}
})
] -->
//
const webpackAliyunOss = [
//
new WebpackAliyunOss({
//
// from: './dist/**', // 上传那个文件或文件夹 可以是字符串或数组
//
// dist: 'web_admin/', // 需要上传到oss上的给定文件目录
//
// region: 'oss-cn-shenzhen',
//
// bucket: 'ppy-prod-webadmin',
//
// test: true,
//
setOssPath: (filePath) => {
//
// some operations to filePath
//
const index = filePath.lastIndexOf('dist')
//
const Path = filePath.substring(index + 4, filePath.length)
//
return Path.replace(/\/g, '/')
//
},
//
setHeaders: (filePath) => {
//
// some operations to filePath
//
// return false to use default header
//
return {
//
'Cache-Control': 'max-age=31536000'
//
}
//
}
//
})
// ]
if
(
NODE_ENV
===
'production'
)
{
config
.
plugins
=
[...
webpackAliyunOss
,
...
config
.
plugins
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment