Skip to content

Commit

Permalink
fix4288 修改立即执行函数
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiyu8 committed Aug 27, 2019
1 parent f52b655 commit af699d3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/taro-cli/src/quickapp/style/declaration/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
import * as fs from 'fs-extra'
import * as path from 'path'

import {
processDeclarationValue
} from '../util'

export const declarations = {}
parse('.')

function parse (dir) {
dir = dir || '.'
const dirPath = path.join(__dirname, dir)
fs.readdirSync(dirPath).forEach(file => {
const filePath = path.join(dirPath, file)
if (fs.statSync(filePath).isFile()) {
if (path.extname(filePath) === '.js') {
Object.assign(declarations, require(filePath)['default'])
}
} else {
parse(path.join(dir, file))
}
})
}

export default function rewriter (declaration, rule, output) {
if (!declaration.position) {
Expand Down

0 comments on commit af699d3

Please sign in to comment.