Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mould-vuecli3
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
lhfe
mould-vuecli3
Commits
bf8c6248
Commit
bf8c6248
authored
Aug 27, 2020
by
lipengcheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉注释
parent
052e36ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
53 deletions
+44
-53
baseUrl.js
config/baseUrl.js
+9
-9
vue.config.js
vue.config.js
+35
-44
No files found.
config/baseUrl.js
View file @
bf8c6248
...
@@ -3,17 +3,17 @@ console.log('process.env:', process.env)
...
@@ -3,17 +3,17 @@ console.log('process.env:', process.env)
console
.
log
(
'process.env.NODE_ENV:'
,
process
.
env
.
NODE_ENV
)
console
.
log
(
'process.env.NODE_ENV:'
,
process
.
env
.
NODE_ENV
)
//
//
switch
(
process
.
env
.
NODE_ENV
)
{
switch
(
process
.
env
.
NODE_ENV
)
{
case
'development'
:
case
'development'
:
baseUrl
=
'http://localhost:3000/development'
//开发环境url
baseUrl
=
'http://localhost:3000/development'
//开发环境url
break
break
case
'passports'
:
// 注意这里的名字要和步骤二中设置的环境名字对应起来
case
'passports'
:
// 注意这里的名字要和步骤二中设置的环境名字对应起来
baseUrl
=
'http://localhost:3000/passports'
//测试环境中的url
baseUrl
=
'http://localhost:3000/passports'
//测试环境中的url
break
break
case
'production'
:
case
'production'
:
baseUrl
=
'http://106.13.94.82:3000/production'
//生产环境url
baseUrl
=
'http://106.13.94.82:3000/production'
//生产环境url
break
break
}
}
export
default
baseUrl
export
default
baseUrl
vue.config.js
View file @
bf8c6248
/*
* @Date: 2020-08-27 09:05:54
* @LastEditors: OBKoro1
* @LastEditTime: 2020-08-27 15:30:17
* @FilePath: /vue.config.js
* @Description: 描述
* @Author: huacong
* @
*/
// console.log(`process.env1:`, process.env);
// console.log(`process.env1:`, process.env);
console
.
log
(
'process.env.NODE_ENV1:'
,
process
.
env
.
NODE_ENV
)
console
.
log
(
'process.env.NODE_ENV1:'
,
process
.
env
.
NODE_ENV
)
module
.
exports
=
{
module
.
exports
=
{
// outputDir: process.env.outputDir,
// outputDir: process.env.outputDir,
// assetsDir: 'static',
// assetsDir: 'static',
publicPath
:
'/'
,
publicPath
:
'/'
,
devServer
:
{
devServer
:
{
open
:
true
,
open
:
true
,
// host: '0.0.0.0',
// host: '0.0.0.0',
port
:
3018
,
port
:
3018
,
https
:
false
,
https
:
false
,
hotOnly
:
false
,
hotOnly
:
false
,
proxy
:
{
proxy
:
{
webapi
:
{
webapi
:
{
target
:
'https://test2.laihua.com/'
,
target
:
'https://test2.laihua.com/'
,
ws
:
true
,
ws
:
true
,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/webapi'
:
'/'
}
pathRewrite
:
{
'^/webapi'
:
'/'
}
}
}
}
},
chainWebpack
:
(
config
)
=>
{
config
.
module
.
rule
(
'eslint'
)
.
use
(
'eslint-loader'
)
.
loader
(
'eslint-loader'
)
.
tap
((
options
)
=>
{
// 保存自动eslint修复
options
.
fix
=
true
return
options
})
},
css
:
{
loaderOptions
:
{
sass
:
{
prependData
:
'@import "@/assets/style/index.scss";'
}
}
}
}
},
chainWebpack
:
(
config
)
=>
{
config
.
module
.
rule
(
'eslint'
)
.
use
(
'eslint-loader'
)
.
loader
(
'eslint-loader'
)
.
tap
((
options
)
=>
{
// 保存自动eslint修复
options
.
fix
=
true
return
options
})
},
css
:
{
loaderOptions
:
{
sass
:
{
prependData
:
'@import "@/assets/style/index.scss";'
}
}
}
}
}
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