diff --git a/lib/source-package.js b/lib/source-package.js index 661c06a..1db63d3 100644 --- a/lib/source-package.js +++ b/lib/source-package.js @@ -96,7 +96,7 @@ var path = require('path') this.packageJSON = packageJSON if (!this.packageJSON.main) this.packageJSON.main = './index.js' - if (!this.packageJSON.main.match(/\.js$/)) this.packageJSON.main += '.js' + if (typeof this.packageJSON.main == "string" && !this.packageJSON.main.match(/\.js$/)) this.packageJSON.main += '.js' // custom hasher function for async.memoize so we have a single key, default will use // first arg (callback) as hash key which won't work @@ -196,4 +196,4 @@ var path = require('path') module.exports.create = function (packageName, parents, isClient, packageJSON, options) { return Object.create(SourcePackage).init(packageName, parents, isClient, packageJSON, options) -} \ No newline at end of file +}