更新
This commit is contained in:
1 parent
5cd551a08e
commit
40cde540d6
33 files changed
+547
-319
No files matched your search
@@ -1,9 +1,12 @@
|
||||
---
|
||||
title: vue CLI 代理设置以及打包引入配置
|
||||
tags: []
|
||||
id: '173'
|
||||
categories:
|
||||
- - 分享
|
||||
- 分享
|
||||
tags:
|
||||
- vue
|
||||
- CLI
|
||||
- 代理
|
||||
date: 2017-10-17 15:25:49
|
||||
---
|
||||
|
||||
@@ -11,7 +14,7 @@ date: 2017-10-17 15:25:49
|
||||
|
||||
在用 [vue CLI](https://www.npmjs.com/package/vue-cli) 做开发的时候,很多时候我们需要用到代理请求获取数据,[vue CLI](https://www.npmjs.com/package/vue-cli) 也很方便的为我们提供配置代理的API,打开[vue CLI](https://www.npmjs.com/package/vue-cli)项目的 _/config/index.js_ 文件,找到dev里的proxyTable
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
module.exports = {
|
||||
//代理设置
|
||||
@@ -37,7 +40,7 @@ module.exports = {
|
||||
|
||||
我们用[vue CLI](https://www.npmjs.com/package/vue-cli)打包项目的时候默认引入的资源是"/"根目录,如果我们的项目在非根目录下就要重新配置一下了,同样的,打开[vue CLI](https://www.npmjs.com/package/vue-cli)项目的 _/config/index.js_ 文件,找到build里的assetsPublicPath
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
module.exports = {
|
||||
build: {
|
||||
@@ -51,4 +54,4 @@ module.exports = {
|
||||
productionGzipExtensions: ['js', 'css'],
|
||||
bundleAnalyzerReport: process.env.npm_config_report
|
||||
}
|
||||
```
|
||||
```
|
||||
Reference in new issue
Block a user