提交 d4405f5b 编写于 作者: H HRK

fix: 针对百度小程序进行css本地资源路径进行处理

上级 47238433
...@@ -106,15 +106,17 @@ module.exports = function chainWebpack (platformOptions, vueOptions, api) { ...@@ -106,15 +106,17 @@ module.exports = function chainWebpack (platformOptions, vueOptions, api) {
}) })
} }
} else { } else {
if (process.env.UNI_PLATFORM === "mp-baidu") {
langRule.oneOf(type) langRule.oneOf(type)
.use('extract-css-loader') .use('extract-css-loader')
.tap(options => { .tap(options => {
// 参考 https://github.com/vuejs/vue-cli/commit/b41ed76c5ce54c618587f24b9d14c35cf31a96d4 // 参考 https://github.com/vuejs/vue-cli/commit/b41ed76c5ce54c618587f24b9d14c35cf31a96d4
// 修复 部分平台 css 内的资源路径不正确,如uni-icons在百度小程序上引用的字体文件路径 // 修复 部分平台 css 内的资源路径不正确,如uni-icons在百度小程序上引用的字体文件路径
options.publicPath = '/' if (options) options.publicPath = '/'
return options return options
}) })
} }
}
langRule.oneOf(type) langRule.oneOf(type)
.use('uniapp-preprocss') .use('uniapp-preprocss')
.loader(resolve('packages/webpack-preprocess-loader')) .loader(resolve('packages/webpack-preprocess-loader'))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册