vue.config.js 782 B

12345678910111213141516171819202122232425262728293031
  1. const path = require("path");
  2. const resolve = (dir) => {
  3. return path.join(__dirname, dir);
  4. };
  5. module.exports = {
  6. publicPath: "./",
  7. lintOnSave: false,
  8. pages: {
  9. index: {
  10. entry: 'src/main.js',
  11. title: '监控大屏'
  12. }
  13. },
  14. devServer: {
  15. port: 8080,
  16. host: "0.0.0.0",
  17. proxy: {
  18. "/prod-api": {
  19. target: "http://47.103.79.143:9876", // 后台接口域名
  20. changeOrigin: true, // 开启代理,在本地创建一个虚拟服务端
  21. pathRewrite: {
  22. "^/prod-api": "", // 重写路径,去掉路径前缀 '/api'
  23. },
  24. },
  25. },
  26. },
  27. chainWebpack: (config) => {
  28. config.resolve.alias.set("_c", resolve("src/components")); // key,value自行定义,比如.set('@@', resolve('src/components'))
  29. },
  30. };