Skip to content

Commit

Permalink
fix(mp-baidu): 修复 支持在 css 中引用本地资源的小程序平台,资源路径可能错误的Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fxy060608 committed Apr 16, 2024
1 parent 044f744 commit 9282021
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/vue-cli-plugin-uni/lib/chain-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,21 @@ module.exports = function chainWebpack (platformOptions, vueOptions, api) {
.use('extract-css-loader')
.tap(options => {
options.esModule = false
// 参考 https://github.com/vuejs/vue-cli/commit/b41ed76c5ce54c618587f24b9d14c35cf31a96d4
// 修复 部分平台 css 内的资源路径不正确,如uni-icons在百度小程序上引用的字体文件路径
options.publicPath = '/'
return options
})
}
} else {
langRule.oneOf(type)
.use('extract-css-loader')
.tap(options => {
// 参考 https://github.com/vuejs/vue-cli/commit/b41ed76c5ce54c618587f24b9d14c35cf31a96d4
// 修复 部分平台 css 内的资源路径不正确,如uni-icons在百度小程序上引用的字体文件路径
options.publicPath = '/'
return options
})
}
langRule.oneOf(type)
.use('uniapp-preprocss')
Expand Down

0 comments on commit 9282021

Please sign in to comment.