Skip to content

Commit

Permalink
Support for transpiling the code without also bundling it (fixes #204)
Browse files Browse the repository at this point in the history
Also added a simple entry-point module that exports the essentials if you
just import the "dalliance" module.  Can still import dalliance/lib/whatever
if you need something specific.
  • Loading branch information
dasmoth committed Nov 4, 2016
1 parent 0fad48d commit 2665363
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
20 changes: 20 additions & 0 deletions js/module-exports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */

//
// Dalliance Genome Explorer
// (c) Thomas Down 2006-2016
//
// module-exports.js: entry point when loading as an NPM-style module
//

"use strict";

const cbrowser = require('./cbrowser');
const sourceadapters = require('./sourceadapters');

module.exports = {
Browser: cbrowser.Browser,
registerSourceAdapterFactory: sourceadapters.registerSourceAdapterFactory,
registerParserFactory: sourceadapters.registerParserFactory,
makeParser: sourceadapters.makeParser
};
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dalliance",
"version": "0.13.8",
"version": "0.13.90-alpha",
"description": "Fast, embeddable genome visualization",
"homepage": "https://www.biodalliance.org/",
"license": "BSD-2-Clause",
Expand All @@ -14,7 +14,7 @@
"ramda": "^0.21.0"
},
"devDependencies": {
"babel-cli": "^6.11.4",
"babel-cli": "^6.18.0",
"babel-core": "^6.13.2",
"babel-polyfill": "^6.9.1",
"babel-preset-es2015": "^6.13.2",
Expand All @@ -35,5 +35,10 @@
"vinyl-buffer": "1.0.0",
"vinyl-source-stream": "1.1.0",
"watchify": "~3.6.1"
},
"files": ["lib", "css", "fonts", "help", "img", "build/worker-all.js"],
"main": "lib/module-exports.js",
"scripts": {
"compile": "babel js -d lib && gulp compile-worker"
}
}

0 comments on commit 2665363

Please sign in to comment.