Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
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
bp
op-web-service
Commits
c4870fa3
Commit
c4870fa3
authored
Sep 01, 2021
by
gengshaojing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: vue config
parent
e0d63de7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
vue.config.js
vue.config.js
+8
-7
No files found.
vue.config.js
View file @
c4870fa3
const
path
=
require
(
"path"
);
const
IS_PROD
=
process
.
env
.
NODE_ENV
===
"production"
;
const
isDev
=
process
.
env
.
NODE_ENV
===
"development"
;
// CDN 链接配置
const
CDN
=
{
...
...
@@ -26,16 +27,16 @@ const CDN = {
};
module
.
exports
=
{
outputDir
:
!
IS_PROD
?
"./dist"
:
path
.
resolve
(
"./public/dist/"
),
publicPath
:
!
IS_PROD
?
"/"
:
"/dist"
,
lintOnSave
:
!
IS_PROD
,
outputDir
:
isDev
?
"./dist"
:
path
.
resolve
(
"./public/dist/"
),
publicPath
:
isDev
?
"/"
:
"/dist"
,
lintOnSave
:
isDev
,
productionSourceMap
:
false
,
// 去掉生成环境的 sourceMap
devServer
:
{
proxy
:
"http://127.0.0.1:8055"
,
//http://localhost:8055
hot
:
true
,
disableHostCheck
:
true
,
},
configureWebpack
:
config
=>
{
configureWebpack
:
(
config
)
=>
{
if
(
IS_PROD
)
{
config
.
externals
=
CDN
.
externals
;
}
...
...
@@ -46,7 +47,7 @@ module.exports = {
maxAssetSize
:
30000000
,
};
},
chainWebpack
:
config
=>
{
chainWebpack
:
(
config
)
=>
{
// 默认不开启 prefetch
config
.
plugins
.
delete
(
"prefetch"
);
...
...
@@ -57,7 +58,7 @@ module.exports = {
config
.
resolve
.
alias
.
set
(
"@"
,
path
.
resolve
(
"src"
));
// 修改页面 title
config
.
plugin
(
"html"
).
tap
(
args
=>
{
config
.
plugin
(
"html"
).
tap
(
(
args
)
=>
{
args
[
0
].
title
=
"运营管理系统"
;
if
(
IS_PROD
)
{
args
[
0
].
cdn
=
CDN
.
build
;
...
...
@@ -67,7 +68,7 @@ module.exports = {
});
// 分包
config
.
when
(
IS_PROD
,
config
=>
{
config
.
when
(
IS_PROD
,
(
config
)
=>
{
config
.
optimization
.
splitChunks
({
chunks
:
"all"
,
cacheGroups
:
{
...
...
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