index.js 3.1 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 33 34 35 36 37 38 39
      "/third-login/": {
        target: "https://yongma16.xyz/third-login/", //后端接口地址
        ws: true, //接受websocket请求
        changeOrigin: true, //是否允许跨越
        chunkOrigins: true,
        pathRewrite: {
          "^/third-login": "", //重写,
        },
      },
Y
yma16 已提交
40
    },
yma16's avatar
yma16 已提交
41

Y
yma16 已提交
42 43 44 45 46 47 48
    // 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 已提交
49

Y
yma16 已提交
50 51 52 53 54 55 56
    // 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 已提交
57

Y
yma16 已提交
58 59 60
    /**
     * Source Maps
     */
yma16's avatar
yma16 已提交
61

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

Y
yma16 已提交
65 66 67 68
    // 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 已提交
69

70
    cssSourceMap: true,
Y
yma16 已提交
71
  },
yma16's avatar
yma16 已提交
72

Y
yma16 已提交
73 74 75 76 77
  build: {
    // Template for index.html
    index: path.resolve(__dirname, "../dist/index.html"),
    // Paths
    assetsRoot: path.resolve(__dirname, "../dist"),
yma16's avatar
yma16 已提交
78
    assetsSubDirectory: "myblog_static",
Y
yma16 已提交
79 80 81 82
    assetsPublicPath: "./",
    /**
     * Source Maps
     */
yma16's avatar
yma16 已提交
83
    productionSourceMap: false,
Y
yma16 已提交
84 85
    // https://webpack.js.org/configuration/devtool/#production
    devtool: "#source-map",
yma16's avatar
yma16 已提交
86 87
    // 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 已提交
88 89
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
yma16's avatar
yma16 已提交
90
    productionGzip: true,
Y
yma16 已提交
91
    productionGzipExtensions: ["js", "css"],
yma16's avatar
yma16 已提交
92

yma16's avatar
yma16 已提交
93
    isIgnoreLogs:true,
Y
yma16 已提交
94 95 96 97 98 99 100
    // 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,
  },
};