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

feat(v3): change svg,midia limit

上级 8de4eab4
......@@ -145,22 +145,25 @@ const v3 = {
const isAppView = !!vueOptions.pluginOptions['uni-app-plus']['view']
// 处理静态资源
webpackConfig.module
.rule('images')
.use('url-loader')
.loader('url-loader')
.tap(options => Object.assign(options, {
limit: 1,
fallback: {
loader: 'file-loader',
options: {
emitFile: isAppView,
name: '[name].[ext]',
useRelativePath: true,
context: process.env.UNI_INPUT_DIR
const staticTypes = ['images', 'svg', 'media', 'fonts']
staticTypes.forEach(staticType => {
webpackConfig.module
.rule(staticType)
.use('url-loader')
.loader('url-loader')
.tap(options => Object.assign(options, {
limit: 1,
fallback: {
loader: 'file-loader',
options: {
emitFile: isAppView,
name: '[name].[ext]',
useRelativePath: true,
context: process.env.UNI_INPUT_DIR
}
}
}
}))
}))
})
const cacheConfig = {
cacheDirectory: false,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册