How to use / import tabby with webpack? v3
juandinella opened this issue · 6 comments
juandinella commented
How should import and use the lib with Webpack and ES6 Modules? I imported this way
import Tabby from 'tabsjs-lib/dist/tabby.iife'
But I get Uncaught TypeError: tabsjs_lib_dist_tabby_iife__WEBPACK_IMPORTED_MODULE_0___default.a.init is not a function
Thanks
janmarkuslanger commented
Did you install tabby via npm?
juandinella commented
Did you install tabby via npm?
Yes I did
janmarkuslanger commented
If you install it via npm you can use tabby like this:
import { init } from 'tabsjs-lib';
init();
or like this
const Tabby = require('tabsjs-lib');
Tabby.init();
Let me know if this works for you. 🤔
janmarkuslanger commented
@juandinella Is it working for you?
juandinella commented
It's working perfect. Thanks!
janmarkuslanger commented
Great if you like it feel free to share and like it! ⭐️