monorepo-microservice-rbac/apps/aorta/scripts/loaders/img.loader.ts
2023-08-27 14:37:59 +08:00

12 lines
317 B
TypeScript

export default {
test: /\.(png|jpe?g|gif|svg)$/i, // 匹配图片文件
type: "asset", // type选择asset
parser: {
dataUrlCondition: {
maxSize: 20 * 1024, // 小于10kb转base64
}
},
generator: {
filename: 'static/images/[name].[contenthash:8][ext]', // 文件输出目录和命名
},
}