提交 eeb9045a 编写于 作者: fxy060608's avatar fxy060608

fix(v3): svg loader

上级 3257c37e
...@@ -145,7 +145,16 @@ const v3 = { ...@@ -145,7 +145,16 @@ const v3 = {
const isAppView = !!vueOptions.pluginOptions['uni-app-plus']['view'] const isAppView = !!vueOptions.pluginOptions['uni-app-plus']['view']
// 处理静态资源 // 处理静态资源
const staticTypes = ['images', 'svg', 'media', 'fonts'] webpackConfig.module
.rule('svg')
.use('file-loader')
.options({
emitFile: isAppView,
outputPath (url, resourcePath, context) {
return path.relative(process.env.UNI_INPUT_DIR, resourcePath)
}
})
const staticTypes = ['images', 'media', 'fonts']
staticTypes.forEach(staticType => { staticTypes.forEach(staticType => {
webpackConfig.module webpackConfig.module
.rule(staticType) .rule(staticType)
...@@ -157,9 +166,9 @@ const v3 = { ...@@ -157,9 +166,9 @@ const v3 = {
loader: 'file-loader', loader: 'file-loader',
options: { options: {
emitFile: isAppView, emitFile: isAppView,
name: '[name].[ext]', outputPath (url, resourcePath, context) {
useRelativePath: true, return path.relative(process.env.UNI_INPUT_DIR, resourcePath)
context: process.env.UNI_INPUT_DIR }
} }
} }
})) }))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册