Skip to content

Commit

Permalink
Fea: add babel-runtime alias for check dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
welefen committed Mar 3, 2016
1 parent de40819 commit d36f1be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/util/checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,17 @@ export default {
}
let data = JSON.parse(fs.readFileSync(packageFile, 'utf8'));
let dependencies = think.extend({}, data.dependencies);
//only merge devDependencies in development env
if(think.env === 'development'){
dependencies = think.extend(dependencies, data.devDependencies);
}
//package alias
let pkgAlias = {
'babel-runtime': 'babel-runtime/helpers/inherits'
}
let pkgPath = `${think.ROOT_PATH}${think.sep}node_modules${think.sep}`;
for(let pkg in dependencies){
pkg = pkgAlias[pkg] || pkg;
if(think.isDir(`${pkgPath}${pkg}`)){
continue;
}
Expand Down

0 comments on commit d36f1be

Please sign in to comment.