index.js 3.4 KB
Newer Older
Y
yma16 已提交
1
"use strict";
yma16's avatar
yma16 已提交
2 3 4
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.

Y
yma16 已提交
5
const path = require("path");
yma16's avatar
yma16 已提交
6 7

module.exports = {
Y
yma16 已提交
8 9
  dev: {
    // Paths
yma16's avatar
yma16 已提交
10
    assetsSubDirectory: "myblog_static",
Y
yma16 已提交
11 12 13
    assetsPublicPath: "/",
    proxyTable: {
      "/api/": {
yma16's avatar
yma16 已提交
14
        target: "https://yongma16.xyz/", //后端接口地址
Y
yma16 已提交
15 16 17 18
        ws: true, //接受websocket请求
        changeOrigin: true, //是否允许跨越
        chunkOrigins: true,
        pathRewrite: {
yma16's avatar
yma16 已提交
19
          "^/api": "api", //重写,
yma16's avatar
yma16 已提交
20
        },
Y
yma16 已提交
21 22
      },
      "/ws_api/": {
yma16's avatar
yma16 已提交
23
        target: "wss://yongma16.xyz/ws/webchat/",
Y
yma16 已提交
24 25 26 27 28 29 30
        ws: true, //接受websocket请求
        changeOrigin: true, //是否允许跨越
        chunkOrigins: true,
        pathRewrite: {
          "^/ws_api": "", //重写,
        },
      },
yma16's avatar
yma16 已提交
31 32
      // line

yma16's avatar
yma16 已提交
33 34 35 36 37 38 39 40
      "/third-login/": {
        target: "https://yongma16.xyz/third-login/", //后端接口地址
        changeOrigin: true, //是否允许跨越
        chunkOrigins: true,
        pathRewrite: {
          "^/third-login": "", //重写,
        },
      },
yma16's avatar
yma16 已提交
41 42 43 44 45 46 47 48 49 50 51 52

      // local

      // "/third-login/": {
      //   target: "http://localhost:6677/", //后端接口地址
      //   ws: true, //接受websocket请求
      //   changeOrigin: true, //是否允许跨越
      //   chunkOrigins: true,
      //   pathRewrite: {
      //     "^/third-login": "", //重写,
      //   },
      // },
Y
yma16 已提交
53
    },
yma16's avatar
yma16 已提交
54

Y
yma16 已提交
55 56 57 58 59 60 61
    // Various Dev Server settings
    host: "localhost", // can be overwritten by process.env.HOST
    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
yma16's avatar
yma16 已提交
62

Y
yma16 已提交
63 64 65 66 67 68 69
    // Use Eslint Loader?
    // If true, your code will be linted during bundling and
    // linting errors and warnings will be shown in the console.
    useEslint: false,
    // If true, eslint errors and warnings will also be shown in the error overlay
    // in the browser.
    showEslintErrorsInOverlay: false,
yma16's avatar
yma16 已提交
70

Y
yma16 已提交
71 72 73
    /**
     * Source Maps
     */
yma16's avatar
yma16 已提交
74

Y
yma16 已提交
75 76
    // https://webpack.js.org/configuration/devtool/#development
    devtool: "cheap-module-eval-source-map",
yma16's avatar
yma16 已提交
77

Y
yma16 已提交
78 79 80 81
    // If you have problems debugging vue-files in devtools,
    // set this to false - it *may* help
    // https://vue-loader.vuejs.org/en/options.html#cachebusting
    cacheBusting: true,
yma16's avatar
yma16 已提交
82

83
    cssSourceMap: true,
Y
yma16 已提交
84
  },
yma16's avatar
yma16 已提交
85

Y
yma16 已提交
86 87 88 89 90
  build: {
    // Template for index.html
    index: path.resolve(__dirname, "../dist/index.html"),
    // Paths
    assetsRoot: path.resolve(__dirname, "../dist"),
yma16's avatar
yma16 已提交
91
    assetsSubDirectory: "myblog_static",
yma16's avatar
yma16 已提交
92
    assetsPublicPath: "/",
Y
yma16 已提交
93 94 95
    /**
     * Source Maps
     */
yma16's avatar
yma16 已提交
96
    productionSourceMap: false,
Y
yma16 已提交
97 98
    // https://webpack.js.org/configuration/devtool/#production
    devtool: "#source-map",
yma16's avatar
yma16 已提交
99 100
    // Gzip off by default as many popular myblog_static hosts such as
    // Surge or Netlify already gzip all myblog_static assets for you.
Y
yma16 已提交
101 102
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
yma16's avatar
yma16 已提交
103
    productionGzip: true,
Y
yma16 已提交
104
    productionGzipExtensions: ["js", "css"],
yma16's avatar
yma16 已提交
105

yma16's avatar
yma16 已提交
106
    isIgnoreLogs:true,
Y
yma16 已提交
107 108 109 110 111 112 113
    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report,
  },
};