it-console/code/web/IT工具综合平台/vue.config.js

54 lines
1.4 KiB
JavaScript
Raw Normal View History

2023-01-29 02:17:49 +00:00
/*
* @Author: Kane
* @Date: 2022-12-17 11:08:18
* @LastEditors: Kane
2023-02-07 12:01:15 +00:00
* @LastEditTime: 2023-02-07 12:27:02
* @FilePath: /IT/vue.config.js
2023-01-29 02:17:49 +00:00
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
// const { defineConfig } = require('@vue/cli-service');
// module.exports = defineConfig(
// {
// transpileDependencies: true,
// devServer: {
// open: true,
// host: "localhost",
// port: 8000,
// },
// }
// );
module.exports = {
transpileDependencies: true,
devServer: {
open: true,
host: "localhost",
port: 8000,
},
chainWebpack: (config) =>
{
// svg 图标解析
const svgRule = config.module.rule("svg"); //默认规则赋给 subRule 变量
svgRule.uses.clear(); // 清除已有的所有规则。
svgRule // 添加要替换的规则
.use("svg-sprite-loader")
.loader("svg-sprite-loader")
.options({
symbolId: "icon-[name]",
2023-02-07 12:01:15 +00:00
include: ["./src/components/svg/icons",], // 特别注意的目录路径
2023-01-29 02:17:49 +00:00
});
// 配置base64转换规则
// config.module
// .rule('images')
// .use('url-loader')
// .loader('url-loader')
// .tap(options => Object.assign(options, { limit: 1 }));
// 载入项目分析工具
// config.plugin('webpack-bundle-analyzer').use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
},
2023-02-07 12:01:15 +00:00
//打包输出目录
publicPath: "./",
outputDir: "dist",
2023-01-29 02:17:49 +00:00
};