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

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

上级 a1fbbd24
const path = require('path') const path = require('path')
const {
const isWin = /^win/.test(process.platform) normalizeNodeModules
} = require('./util')
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
module.exports = { module.exports = {
loader: 'file-loader', loader: 'file-loader',
options: { options: {
publicPath (url, resourcePath, context) { 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) { 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.
先完成此消息的编辑!
想要评论请 注册