Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
2betop committed Aug 21, 2015
1 parent 773cdb9 commit c352e62
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
11 changes: 3 additions & 8 deletions amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ var _ = fis.util;
var amd = module.exports = function(info, conf) {
var file = info.file;

try {
autowrap(info, conf);
info.content = parse(file, info.content, conf);
info.content = amd.restoreFISLang(info.content);
} catch (e) {
fis.log.warn('Got Error: %s while parse [%s].', e.message, file.subpath);
fis.log.debug(e.stack);
}
autowrap(info, conf);
info.content = parse(file, info.content, conf);
info.content = amd.restoreFISLang(info.content);
};

// 判断是否是 amd
Expand Down
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ var entry = module.exports = function(fis, opts) {
if (file.isMod || shimed) {
// 用户主动配置了 shim 那么说明目标文件一定是模块化 js
shimed && (file.isMod = true);
amd(info, opts);
try {
amd(info, opts);
} catch (e) {
fis.log.warn('Got Error: %s while parse [%s].', e.message, file.subpath);
fis.log.debug(e.stack);
}
} else {

// 先尝试 amd 解析,失败则走 commonJs
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fis3-hook-amd",
"version": "0.0.6",
"version": "0.1.0",
"description": "fis3 amd",
"main": "index.js",
"scripts": {
Expand All @@ -25,6 +25,6 @@
"escope": "^3.2.0",
"esprima": "^2.5.0",
"estraverse": "^4.1.0",
"fis3-hook-commonjs": "0.0.1"
"fis3-hook-commonjs": "0.1.0"
}
}

0 comments on commit c352e62

Please sign in to comment.