Comparing version 0.1.5 to 0.1.6
23
index.js
@@ -18,16 +18,21 @@ 'use strict'; | ||
this.setConfig(conf); | ||
try { | ||
this.setConfig(conf); | ||
if (_.isJS(src)) { | ||
file = new JSFile(src); | ||
if (_.isJS(src)) { | ||
file = new JSFile(src); | ||
} else if (_.isHtml(src)) { | ||
file = new HtmlFile(src); | ||
} else if (_.isHtml(src)) { | ||
file = new HtmlFile(src); | ||
} | ||
if (file) { | ||
file.parse(); | ||
return file; | ||
} | ||
} catch (e) { | ||
console.dir('1' + e); | ||
} | ||
if (file) { | ||
file.parse(); | ||
return file; | ||
} | ||
return false; | ||
} | ||
}; |
@@ -62,5 +62,5 @@ 'use strict'; | ||
buildTag: function (file) { | ||
var ext = file.ext, | ||
var ext = file.ext || 'js', | ||
cssExts = ['less', 'scss', 'sass'], | ||
rPath = file.subpath, | ||
rPath = config.get('fileBasedRoot') ? ('/' + file.subpath) : file.subpath, | ||
regExp; | ||
@@ -67,0 +67,0 @@ |
{ | ||
"name": "jsm2c", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "将采用commonJS规范的模块化代码,转译成闭包形式的代码", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31188
718