You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							87 lines
						
					
					
						
							2.3 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							87 lines
						
					
					
						
							2.3 KiB
						
					
					
				
								/*
							 | 
						|
								 * @Author: mk 2403457699@qq.com
							 | 
						|
								 * @Date: 2023-08-28 19:45:33
							 | 
						|
								 * @LastEditors: mk 2403457699@qq.com
							 | 
						|
								 * @LastEditTime: 2023-09-12 19:24:04
							 | 
						|
								 * @Description: 介绍一下改动了什么
							 | 
						|
								 *
							 | 
						|
								 *
							 | 
						|
								 */
							 | 
						|
								/**
							 | 
						|
								 * 配置参考: https://cli.vuejs.org/zh/config/
							 | 
						|
								 */
							 | 
						|
								const IS_PROD = ["production", "test"].includes(process.env.NODE_ENV);
							 | 
						|
								const FileManagerPlugin = require("filemanager-webpack-plugin");
							 | 
						|
								
							 | 
						|
								module.exports = {
							 | 
						|
								  baseUrl: process.env.NODE_ENV === "production" ? "" : "/epmet-work-pc",
							 | 
						|
								  css: {
							 | 
						|
								    // 是否使用css分离插件 ExtractTextPlugin
							 | 
						|
								    extract: IS_PROD,
							 | 
						|
								    // 开启 CSS source maps?
							 | 
						|
								    sourceMap: false,
							 | 
						|
								    // css预设器配置项
							 | 
						|
								    loaderOptions: {},
							 | 
						|
								    // 启用 CSS modules for all css / pre-processor files.
							 | 
						|
								    modules: false,
							 | 
						|
								  },
							 | 
						|
								  chainWebpack: (config) => {
							 | 
						|
								    const svgRule = config.module.rule("svg");
							 | 
						|
								    svgRule.uses.clear();
							 | 
						|
								    svgRule
							 | 
						|
								      .test(/\.svg$/)
							 | 
						|
								      .use("svg-sprite-loader")
							 | 
						|
								      .loader("svg-sprite-loader");
							 | 
						|
								  },
							 | 
						|
								  productionSourceMap: false,
							 | 
						|
								  outputDir: "epmet-work-pc",
							 | 
						|
								  assetsDir: "static",
							 | 
						|
								  devServer: {
							 | 
						|
								    proxy: {
							 | 
						|
								      // 如果请求地址以/api打头,就出触发代理机制
							 | 
						|
								      // http://localhost:9588/api/login -> http://localhost:3000/api/login
							 | 
						|
								      "/linkdata/linkdata-gateway/route": {
							 | 
						|
								        target: "http://bipaas.elinkservice.cn", // 我们要代理的真实接口地址
							 | 
						|
								      },
							 | 
						|
								      "/api": {
							 | 
						|
								        target: "http://localhost:8080", // 后端接口地址
							 | 
						|
								        changeOrigin: true,
							 | 
						|
								        pathRewrite: {
							 | 
						|
								          "^api": "",
							 | 
						|
								        },
							 | 
						|
								      },
							 | 
						|
								    },
							 | 
						|
								    open: false,
							 | 
						|
								    port: 9001,
							 | 
						|
								    overlay: {
							 | 
						|
								      errors: true,
							 | 
						|
								      warnings: true,
							 | 
						|
								    },
							 | 
						|
								  },
							 | 
						|
								  // webpack简单配置
							 | 
						|
								  configureWebpack: {
							 | 
						|
								    // debuge调试配置
							 | 
						|
								    devtool: "source-map",
							 | 
						|
								    externals: {
							 | 
						|
								      AMap: "AMap",
							 | 
						|
								    },
							 | 
						|
								    resolve: {
							 | 
						|
								      //配置路径别名
							 | 
						|
								      // /node_modules/@vue/cli-service/lib/config/base.js中已经配好的@路径,所以这里可以直接使用@
							 | 
						|
								      alias: {
							 | 
						|
								        "@js": "@/js",
							 | 
						|
								        "@c": "@/views/components",
							 | 
						|
								        "@v": "@/views",
							 | 
						|
								        "@m": "@/img",
							 | 
						|
								      },
							 | 
						|
								    },
							 | 
						|
								    plugins: [
							 | 
						|
								      new FileManagerPlugin({
							 | 
						|
								        onEnd: {
							 | 
						|
								          delete: ["./epmet-work-pc.zip"],
							 | 
						|
								          archive: [{ source: "./epmet-work-pc", destination: "./epmet-work-pc.zip" }],
							 | 
						|
								        },
							 | 
						|
								      }),
							 | 
						|
								    ],
							 | 
						|
								  },
							 | 
						|
								};
							 | 
						|
								
							 |