const path = require("path");
const resolve = (dir) => {
  return path.join(__dirname, dir);
};
module.exports = {
  publicPath: "./",
  lintOnSave: false,
  pages: {
    index: {
      entry: 'src/main.js',
      title: '监控大屏'
    }
  },
  devServer: {
    port: 8080,
    host: "0.0.0.0",
    proxy: {
      "/prod-api": {
        target: "http://47.103.79.143:9876", // 后台接口域名
        changeOrigin: true, // 开启代理，在本地创建一个虚拟服务端
        pathRewrite: {
          "^/prod-api": "", // 重写路径，去掉路径前缀 '/api'
        },
      },
    },
  },
  chainWebpack: (config) => {
    config.resolve.alias.set("_c", resolve("src/components")); // key,value自行定义，比如.set('@@', resolve('src/components'))
  },
};
