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

fix(mp-baidu): normalize asset file (question/154595)

上级 a1fbbd24
const path = require('path')
const isWin = /^win/.test(process.platform)
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
const {
normalizeNodeModules
} = require('./util')
module.exports = {
loader: 'file-loader',
options: {
publicPath (url, resourcePath, context) {
return '/' + normalizePath(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
return '/' + normalizeNodeModules(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
},
outputPath (url, resourcePath, context) {
return normalizePath(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
return normalizeNodeModules(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册