You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
605 B
30 lines
605 B
const path = require('path')
|
|
|
|
const {
|
|
normalizePath
|
|
} = require('@dcloudio/uni-cli-shared')
|
|
|
|
const {
|
|
getPlatformExts
|
|
} = require('../shared')
|
|
|
|
const templateExt = getPlatformExts().template
|
|
|
|
const SLOTS_OUTPUT_PATH = '/[root]common/slots'
|
|
|
|
function getRelativePath (from, to) {
|
|
let relativePath = path.relative(from, to)
|
|
if (relativePath.indexOf('.') !== 0) {
|
|
relativePath = './' + relativePath
|
|
}
|
|
return normalizePath(relativePath)
|
|
}
|
|
|
|
function getSlotsPath (root) {
|
|
return SLOTS_OUTPUT_PATH.replace('[root]', root) + templateExt
|
|
}
|
|
|
|
module.exports = {
|
|
getSlotsPath,
|
|
getRelativePath
|
|
}
|
|
|