|
5 | 5 | constpath=require('path') |
6 | 6 |
|
7 | 7 | module.exports={ |
8 | | -dev:{ |
| 8 | +dev:{ |
| 9 | +// Paths |
| 10 | +assetsSubDirectory:'static', |
| 11 | +assetsPublicPath:'/', |
| 12 | +proxyTable:{ |
| 13 | +'/api':{ |
| 14 | +// 使用"/api"来代替"http://f.apiplus.c" |
| 15 | +target:'http://10.40.107.241:8088',// 源地址 |
| 16 | +changeOrigin:true,// 改变源 |
| 17 | +pathRewrite:{ |
| 18 | +'^/api':'http://10.40.107.241:8088',// 路径重写 |
| 19 | +}, |
| 20 | +}, |
| 21 | +}, |
9 | 22 |
|
10 | | -// Paths |
11 | | -assetsSubDirectory:'static', |
12 | | -assetsPublicPath:'/', |
13 | | -proxyTable:{}, |
| 23 | +// Various Dev Server settings |
| 24 | +host:'localhost',// can be overwritten by process.env.HOST |
| 25 | +port:8088,// can be overwritten by process.env.PORT, if port is in use, a free one will be determined |
| 26 | +autoOpenBrowser:false, |
| 27 | +errorOverlay:true, |
| 28 | +notifyOnErrors:true, |
| 29 | +poll:false,// https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- |
14 | 30 |
|
15 | | -//Various Dev Server settings |
16 | | -host:'localhost',//canbeoverwritten by process.env.HOST |
17 | | -port:8080,//can be overwritten by process.env.PORT, if port isinuse, a free one will be determined |
18 | | -autoOpenBrowser:false, |
19 | | -errorOverlay:true, |
20 | | -notifyOnErrors:true, |
21 | | -poll:false,// https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- |
| 31 | +//Use Eslint Loader? |
| 32 | +//If true, your code willbelinted during bundling and |
| 33 | +//linting errors and warnings will be showninthe console. |
| 34 | +useEslint:true, |
| 35 | +// Iftrue, eslint errors and warnings will also be shown in the error overlay |
| 36 | +// in the browser. |
| 37 | +showEslintErrorsInOverlay:false, |
22 | 38 |
|
23 | | -// Use Eslint Loader? |
24 | | -// If true, your code will be linted during bundling and |
25 | | -// linting errors and warnings will be shown in the console. |
26 | | -useEslint:true, |
27 | | -// If true, eslint errors and warnings will also be shown in the error overlay |
28 | | -// in the browser. |
29 | | -showEslintErrorsInOverlay:false, |
| 39 | +/** |
| 40 | + * Source Maps |
| 41 | + */ |
30 | 42 |
|
31 | | -/** |
32 | | - * Source Maps |
33 | | - */ |
| 43 | +// https://webpack.js.org/configuration/devtool/#development |
| 44 | +devtool:'cheap-module-eval-source-map', |
34 | 45 |
|
35 | | -// https://webpack.js.org/configuration/devtool/#development |
36 | | -devtool:'cheap-module-eval-source-map', |
| 46 | +// If you have problems debugging vue-files in devtools, |
| 47 | +// set this to false - it *may* help |
| 48 | +// https://vue-loader.vuejs.org/en/options.html#cachebusting |
| 49 | +cacheBusting:true, |
37 | 50 |
|
38 | | -// If you have problems debugging vue-files in devtools, |
39 | | -// set this to false - it *may* help |
40 | | -// https://vue-loader.vuejs.org/en/options.html#cachebusting |
41 | | -cacheBusting:true, |
| 51 | +cssSourceMap:true, |
| 52 | +}, |
42 | 53 |
|
43 | | -cssSourceMap:true |
44 | | -}, |
| 54 | +build:{ |
| 55 | +// Template for index.html |
| 56 | +index:path.resolve(__dirname,'../dist/index.html'), |
45 | 57 |
|
46 | | -build:{ |
47 | | -// Template for index.html |
48 | | -index:path.resolve(__dirname,'../dist/index.html'), |
| 58 | +// Paths |
| 59 | +assetsRoot:path.resolve(__dirname,'../dist'), |
| 60 | +assetsSubDirectory:'static', |
| 61 | +assetsPublicPath:'/', |
49 | 62 |
|
50 | | -// Paths |
51 | | -assetsRoot:path.resolve(__dirname,'../dist'), |
52 | | -assetsSubDirectory:'static', |
53 | | -assetsPublicPath:'/', |
| 63 | +/** |
| 64 | + * Source Maps |
| 65 | + */ |
54 | 66 |
|
55 | | -/** |
56 | | -* Source Maps |
57 | | -*/ |
| 67 | +productionSourceMap:true, |
| 68 | +// https://webpack.js.org/configuration/devtool/#production |
| 69 | +devtool:'#source-map', |
58 | 70 |
|
59 | | -productionSourceMap:true, |
60 | | -// https://webpack.js.org/configuration/devtool/#production |
61 | | -devtool:'#source-map', |
| 71 | +// Gzip off by default as many popular static hosts such as |
| 72 | +// Surge or Netlify already gzip all static assets for you. |
| 73 | +// Before setting to `true`, make sure to: |
| 74 | +// npm install --save-dev compression-webpack-plugin |
| 75 | +productionGzip:false, |
| 76 | +productionGzipExtensions:['js','css'], |
62 | 77 |
|
63 | | -// Gzip off by default as many popular static hosts such as |
64 | | -// Surge or Netlify already gzip all static assets for you. |
65 | | -// Before setting to `true`, make sure to: |
66 | | -// npm install --save-dev compression-webpack-plugin |
67 | | -productionGzip:false, |
68 | | -productionGzipExtensions:['js','css'], |
69 | | - |
70 | | -// Run the build command with an extra argument to |
71 | | -// View the bundle analyzer report after build finishes: |
72 | | -// `npm run build --report` |
73 | | -// Set to `true` or `false` to always turn it on or off |
74 | | -bundleAnalyzerReport:process.env.npm_config_report |
75 | | -} |
| 78 | +// Run the build command with an extra argument to |
| 79 | +// View the bundle analyzer report after build finishes: |
| 80 | +// `npm run build --report` |
| 81 | +// Set to `true` or `false` to always turn it on or off |
| 82 | +bundleAnalyzerReport:process.env.npm_config_report, |
| 83 | +}, |
76 | 84 | } |