From 0a3c43de339acc4a50267b0059a9252426fd1a13 Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Mon, 30 Oct 2023 21:39:16 +0800 Subject: [PATCH] fix: micro application icon show error --- vue.config.js | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/vue.config.js b/vue.config.js index 23fba30..672a158 100644 --- a/vue.config.js +++ b/vue.config.js @@ -27,21 +27,6 @@ module.exports = { config .when(process.env.NODE_ENV !== 'development', config => { - - // 默认css文件中的url()不能根据__webpack_public_path__来动态改变根路径,将其编译成 base64 内嵌到css文件 - config.module - .rule("fonts") - .test(/.(ttf|otf|eot|woff|woff2)$/) - .use("url-loader") - .loader("url-loader") - .tap((options) => { - options = { - limit: 10000, - name: "/static/fonts/[name].[ext]", - }; - return options; - }) - config.optimization.splitChunks({ chunks: 'all', cacheGroups: { @@ -65,6 +50,16 @@ module.exports = { } } }) + + // fixme: 默认css文件中的url()不能根据__webpack_public_path__来动态改变根路径 + config.module + .rule('fonts') + .test(/.(ttf|otf|eot|woff|woff2)$/) + .use("url-loader") + .loader("url-loader") + .tap((options) => ({ + name: "/static/fonts/[name].[ext]", + })) } ) },