Skip to content

Commit

Permalink
Export module in node context
Browse files Browse the repository at this point in the history
  • Loading branch information
brrd committed Sep 25, 2017
1 parent c116a0f commit 62ae500
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion js/chrome-tabs.js
@@ -1,4 +1,9 @@
(function(){
const isNodeContext = typeof module !== 'undefined' && typeof module.exports !== 'undefined'
if (isNodeContext) {
Draggabilly = require('draggabilly')
}

const tabTemplate = `
<div class="chrome-tab">
<div class="chrome-tab-background">
Expand Down Expand Up @@ -251,5 +256,9 @@
}
}

window.ChromeTabs = ChromeTabs
if (isNodeContext) {
module.exports = ChromeTabs
} else {
window.ChromeTabs = ChromeTabs
}
})()

0 comments on commit 62ae500

Please sign in to comment.