Closed cmdcolin closed 6 years ago
I thought maybe just adding a new entrypoint might help with this but I'm getting an error. Example
% git diff HEAD
diff --git a/src/JBrowse/standalone.js b/src/JBrowse/standalone.js
new file mode 100644
index 0000000..560ea69
--- /dev/null
+++ b/src/JBrowse/standalone.js
@@ -0,0 +1,6 @@
+import 'babel-polyfill'
+import 'css!../../css/genome.scss';
+
+import Browser from 'JBrowse/Browser';
+
+window.Browser = Browser;
diff --git a/webpack.config.js b/webpack.config.js
index e5762e7..4b1adc3 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -28,6 +28,7 @@ const AUTOPREFIXER_BROWSERS = [
var webpackConf = {
entry: {
main: "src/JBrowse/main",
+ browser: "src/JBrowse/standalone"
},
plugins: [
new CleanWebpackPlugin(['dist']),
Then I try using
<script src="dist/browser.bundle.js"></script>
<script>
var JBrowse = new Browser({
containerID: 'GenomeBrowser'
});
</script>
However it says it can't find JB_json_v1 module. I can't remember if there was something that the main bundle has related to this that this new entry point might not...
@cmdcolin the main entry point has some weird magic to load all of the modules that are not explicitly loaded by Browser and dependents. i think JB_json_v1 is a config driver, and it's loaded dynamically @cmdcolin you need to put the //!! glob-loader comment in your new entry point that is actually a command to the webpack loader i wrote that just pulls in all the jbrowse modules in the file tree
if you are working on this, pull it into the current sprint
Nice! Looking forward to checking out the standalone entrypoint for a Galaxy viz.
It was previously that JBrowse's Browser constructor could be called manually. Wrapping the constructor up into src/JBrowse/main was our approach, but it could be made available again
It was brainstormed this way at GCCBOSC for Galaxy visualization templates to make this available again CC @dannon
potentially could be done slightly differently but this was the idea