Skip to content

Commit

Permalink
fix(alita): 修复 wxss文件生成路径错误,修复输出目录不存在emptyDir方法报错
Browse files Browse the repository at this point in the history
  • Loading branch information
ykforerlang committed Jul 6, 2019
1 parent 3e3f454 commit 64390ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ const OUT_DIR = path.resolve(options.outdir)
console.log(`输入目录: ${INPUT_DIR}`.info)
console.log(`输出目录: ${OUT_DIR}`.info)

emptyDir(OUT_DIR, new Set([
'miniprogram_npm',
'node_modules'
]))
console.log('输出目录清理完成'.info)
if (fse.existsSync(OUT_DIR)) {
emptyDir(OUT_DIR, new Set([
'miniprogram_npm',
'node_modules'
]))
console.log('输出目录清理完成'.info)
}


const CONFIGPATH = path.resolve(INPUT_DIR, options.config || 'alita.config.js')
let configObj = DEFAULTCONFIG
Expand Down
3 changes: 2 additions & 1 deletion src/tran/geneWxss.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import fse from "fs-extra";
import {getRootPathPrefix} from '../util/util'

export default function geneWxss(info) {
const {filepath, isPageComp, outComp} = info
let {filepath, isPageComp, outComp} = info
filepath = filepath.replace(".wx.js", ".js");

for (let i = 0; i < outComp.length; i++) {
const name = outComp[i];
Expand Down

0 comments on commit 64390ef

Please sign in to comment.