index.js 2.8 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 10 11 12 13 14 15 16 17 18 19
  dev: {
    // Paths
    assetsSubDirectory: "static",
    assetsPublicPath: "/",
    proxyTable: {
      "/api/": {
        target: "http://114.116.52.53/", //后端接口地址
        ws: true, //接受websocket请求
        changeOrigin: true, //是否允许跨越
        chunkOrigins: true,
        pathRewrite: {
          "^/api": "", //重写,
yma16's avatar
yma16 已提交
20
        },
Y
yma16 已提交
21 22 23 24 25 26 27 28 29 30 31
      },
      "/ws_api/": {
        target: "ws://114.116.52.53/",
        ws: true, //接受websocket请求
        changeOrigin: true, //是否允许跨越
        chunkOrigins: true,
        pathRewrite: {
          "^/ws_api": "", //重写,
        },
      },
    },
yma16's avatar
yma16 已提交
32

Y
yma16 已提交
33 34 35 36 37 38 39
    // 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 已提交
40

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

Y
yma16 已提交
49 50 51
    /**
     * Source Maps
     */
yma16's avatar
yma16 已提交
52

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

Y
yma16 已提交
56 57 58 59
    // 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 已提交
60

Y
yma16 已提交
61 62
    cssSourceMap: true,
  },
yma16's avatar
yma16 已提交
63

Y
yma16 已提交
64 65 66
  build: {
    // Template for index.html
    index: path.resolve(__dirname, "../dist/index.html"),
yma16's avatar
yma16 已提交
67

Y
yma16 已提交
68 69 70 71
    // Paths
    assetsRoot: path.resolve(__dirname, "../dist"),
    assetsSubDirectory: "static",
    assetsPublicPath: "./",
yma16's avatar
yma16 已提交
72

Y
yma16 已提交
73 74 75
    /**
     * Source Maps
     */
yma16's avatar
yma16 已提交
76

Y
yma16 已提交
77 78 79
    productionSourceMap: true,
    // https://webpack.js.org/configuration/devtool/#production
    devtool: "#source-map",
yma16's avatar
yma16 已提交
80

Y
yma16 已提交
81 82 83 84 85 86
    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ["js", "css"],
yma16's avatar
yma16 已提交
87

Y
yma16 已提交
88 89 90 91 92 93 94
    // 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,
  },
};