From e3a82e5f6d5713348d4ef4215665d65461c7e5a0 Mon Sep 17 00:00:00 2001 From: Misha Wakerman Date: Mon, 15 Jun 2015 21:36:44 +1000 Subject: [PATCH 1/2] Preparing module for npm publishing. Added index.js with module.export. Updated the mainfile in package.json to point and the index.js file. --- index.js | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..833397c --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +module.exports = require('./dist/planetaryjs'); diff --git a/package.json b/package.json index 930830f..4341a1c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "planetary.js", "version": "1.1.1", "description": "Awesome interactive globes for the web", - "main": "dist/planetaryjs", + "main": "index.js", "scripts": { "build": "rm -r dist/ ; gulp && cp dist/planetaryjs.min.js site/public/js/lib", "jshint": "gulp jshint", From d9f39116894281a75cc13c4342a116d1cd30a1a7 Mon Sep 17 00:00:00 2001 From: Misha Wakerman Date: Mon, 15 Jun 2015 23:35:40 +1000 Subject: [PATCH 2/2] Realised that `main` needn't change for npm to pick up index.js. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4341a1c..930830f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "planetary.js", "version": "1.1.1", "description": "Awesome interactive globes for the web", - "main": "index.js", + "main": "dist/planetaryjs", "scripts": { "build": "rm -r dist/ ; gulp && cp dist/planetaryjs.min.js site/public/js/lib", "jshint": "gulp jshint",