From f3dcf4c2aeb297c083268a9cfb81f737d86dccf8 Mon Sep 17 00:00:00 2001 From: Frank Lin Date: Mon, 28 Oct 2013 15:28:07 +0800 Subject: [PATCH] fix issue - ender does not support multiple sources in packageJSON.main definition like before --- lib/source-package.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +}