Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
activities
/
web-lottery
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
554db906
authored
Jan 13, 2022
by
赖慧粮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(source): 修复因nuxt进程重启导致time取当前值最终导致资源引入地址错误的问题,更换为版本号替代时间
parent
c87fb8ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
nuxt.config.js
+5
-6
No files found.
nuxt.config.js
View file @
554db906
/* eslint-disable nuxt/no-cjs-in-config */
/* eslint-disable nuxt/no-cjs-in-config */
const
path
=
require
(
'path'
)
const
path
=
require
(
'path'
)
/* version from package.json */
// import packageEnv from './package.json'
/* env configs */
/* env configs */
const
globalEnvConfig
=
require
(
`./config/global.js`
)
const
globalEnvConfig
=
require
(
`./config/global.js`
)
const
envConfig
=
require
(
`./config/
${
process
.
env
.
mode
||
'production'
}
.js`
)
const
envConfig
=
require
(
`./config/
${
process
.
env
.
mode
||
'production'
}
.js`
)
...
@@ -11,7 +8,9 @@ const env = Object.assign(globalEnvConfig, envConfig)
...
@@ -11,7 +8,9 @@ const env = Object.assign(globalEnvConfig, envConfig)
/* ali-oss */
/* ali-oss */
const
WebpackAliOSSPlugin
=
require
(
'@gdyfe/webpack-alioss-plugin'
)
const
WebpackAliOSSPlugin
=
require
(
'@gdyfe/webpack-alioss-plugin'
)
const
time
=
WebpackAliOSSPlugin
.
getFormat
(
'YYMMDD'
)
/* version from package.json */
const
{
version
}
=
require
(
'./package.json'
)
const
PROJECT_NAME
=
'lottery'
const
PROJECT_NAME
=
'lottery'
const
IS_USE_OSS
=
process
.
env
.
NODE_ENV
===
'production'
&&
!
env
.
private
const
IS_USE_OSS
=
process
.
env
.
NODE_ENV
===
'production'
&&
!
env
.
private
...
@@ -25,7 +24,7 @@ const plugins = IS_USE_OSS
...
@@ -25,7 +24,7 @@ const plugins = IS_USE_OSS
bucket
:
`guangdianyun-static-
${
env
.
run_server
}
`
,
bucket
:
`guangdianyun-static-
${
env
.
run_server
}
`
,
prefix
:
PROJECT_NAME
,
prefix
:
PROJECT_NAME
,
limit
:
10
,
// 备份最近 3 个版本的 oss 文件
limit
:
10
,
// 备份最近 3 个版本的 oss 文件
format
:
time
,
format
:
version
,
exclude
:
[
/.*
\.
html$/
],
// 或者 /.*\.html$/,排除.html文件的上传
exclude
:
[
/.*
\.
html$/
],
// 或者 /.*\.html$/,排除.html文件的上传
deleteAll
:
false
,
// 优先匹配 format 配置项
deleteAll
:
false
,
// 优先匹配 format 配置项
output
:
path
.
resolve
(
__dirname
,
'./nuxt-dist/dist/client'
),
output
:
path
.
resolve
(
__dirname
,
'./nuxt-dist/dist/client'
),
...
@@ -146,7 +145,7 @@ export default {
...
@@ -146,7 +145,7 @@ export default {
// Build Configuration: https://go.nuxtjs.dev/config-build
// Build Configuration: https://go.nuxtjs.dev/config-build
build
:
{
build
:
{
publicPath
:
!
env
.
private
publicPath
:
!
env
.
private
?
`
${
REMOTE_OSS_DOMAIN
}
/
${
PROJECT_NAME
}
/
${
time
}
`
?
`
${
REMOTE_OSS_DOMAIN
}
/
${
PROJECT_NAME
}
/
${
version
}
`
:
`/
${
env
.
X_CA_STAGE
.
toLowerCase
()
||
'prod'
}
/`
,
:
`/
${
env
.
X_CA_STAGE
.
toLowerCase
()
||
'prod'
}
/`
,
transpile
:
[
/vant.*
?
less/
],
transpile
:
[
/vant.*
?
less/
],
babel
:
{
babel
:
{
...
...
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