attempt to get npm distribution working
authorDan Vanderkam <danvk@sidewalklabs.com>
Wed, 28 Dec 2016 19:41:10 +0000 (14:41 -0500)
committerDan Vanderkam <danvk@sidewalklabs.com>
Wed, 28 Dec 2016 19:41:10 +0000 (14:41 -0500)
index.js [new file with mode: 0644]
package.json
scripts/build.sh

diff --git a/index.js b/index.js
new file mode 100644 (file)
index 0000000..09aed2e
--- /dev/null
+++ b/index.js
@@ -0,0 +1 @@
+export { default } from './src/dygraph';
index 508b714..a932024 100644 (file)
@@ -1,12 +1,17 @@
 {
   "name": "dygraphs",
-  "version": "1.1.0",
+  "version": "2.0.0-rc2",
   "description": "dygraphs is a fast, flexible open source JavaScript charting library.",
-  "main": "dist/src/dygraph.js",
-  "directories": {
-    "doc": "docs",
-    "test": "tests"
-  },
+  "main": "src-es5/dygraph.js",
+  "module": "index",
+  "jsnext:main": "index",
+  "files": [
+    "index.js",
+    "docs",
+    "dist",
+    "src",
+    "src-es5"
+  ],
   "repository": {
     "type": "git",
     "url": "git://github.com/danvk/dygraphs.git"
@@ -33,6 +38,7 @@
     "browserify-header": "^0.9.2",
     "chai": "^3.3.0",
     "clean-css": "^3.4.23",
+    "core-js": "^2.4.1",
     "coveralls": "^2.11.2",
     "envify": "^3.4.0",
     "exorcist": "^0.4.0",
@@ -43,7 +49,6 @@
     "mocha": "^2.1.0",
     "mocha-phantomjs": "3.5.3",
     "mocha-phantomjs-istanbul": "0.0.2",
-    "obvious-closure-library": "^20140401.0.2",
     "parse-data-uri": "^0.2.0",
     "phantomjs": "^1.9.7-8",
     "pre-commit": "^1.0.6",
@@ -61,8 +66,5 @@
   },
   "pre-commit": [
     "tests-ok"
-  ],
-  "dependencies": {
-    "core-js": "^2.4.1"
-  }
+  ]
 }
index 3122d03..ebdd1d4 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
-# This generates:
-# - dist/dygraph.js
-# - dist/dygraph.js.map
-# - dist/dygraph.min.js
-# - dist/dygraph.min.js.map
+# This generates everything under dist:
+# bundled JS, minified JS, minified CSS and source maps.
 set -o errexit
 
 mkdir -p dist
@@ -52,6 +49,9 @@ jar -cf dist/dygraph-gwt.jar -C gwt org
 cp css/dygraph.css dist/
 cleancss css/dygraph.css -o dist/dygraph.min.css --source-map --source-map-inline-sources
 
+# Build ES5-compatible distribution
+babel src -d src-es5 --compact false
+
 # Remove temp files.
 rm dist/dygraph.tmp.js
 rm dist/dygraph.tmp.js.map