From 54d848deb2d4474ce086312010df476e220378dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Fri, 12 Sep 2025 17:09:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8E=BB=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/prod.ts | 22 +++++++++++++++++++++- src/app.scss | 8 ++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/config/prod.ts b/config/prod.ts index 4fa33e2..7fd7f3a 100644 --- a/config/prod.ts +++ b/config/prod.ts @@ -1,6 +1,26 @@ import type { UserConfigExport } from "@tarojs/cli"; export default { - mini: {}, + mini: { + webpackChain: (chain, webpack) => { + chain.merge({ + plugin: { + install: { + plugin: require('terser-webpack-plugin'), + args: [ + { + terserOptions: { + compress: true, // 默认使用terser压缩 + // mangle: false, + keep_classnames: true, // 不改变class名称 + keep_fnames: true, // 不改变函数名称 + }, + }, + ], + }, + }, + }) + } + }, h5: { /** * WebpackChain 插件配置 diff --git a/src/app.scss b/src/app.scss index 3228f0b..0bd3f2f 100644 --- a/src/app.scss +++ b/src/app.scss @@ -1,4 +1,4 @@ -@font-face { - font-family: 'PoetsenOne'; - src: url('./static/asserts/fonts/PoetsenOne-Regular.ttf') format('truetype'); -} \ No newline at end of file +// @font-face { +// font-family: 'PoetsenOne'; +// src: url('./static/asserts/fonts/PoetsenOne-Regular.ttf') format('truetype'); +// } \ No newline at end of file