-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import part of the library in Typescript #247
Comments
So this information some way too late, but this is what I did in case someone else is googling on how to import a specific piece into their project. |
Hi @lindell, I'm trying out the v4 feature you mention in #263 to import only the parts we want:
I've tried multiple import statements:
Which yielded warnings during the rollup process:
I started looking in your package.json to see which file was the main one, and that's when I saw it was Am I missing something ? |
@jooleeanh |
|
First of all, thanks for the awesome library !
Is there a way to import a section of the library ? I'm integrating JsBarcode in a widget, and JsBarcode ends up taking more space than my source code.
I'd like to either be able to import like such:
import { Code128 } from 'jsbarcode';
Or be able to use the minified versions for the web:
JsBarcode.code128.min.js
I tried importing JsBarcode.code128.min.js with the following statements:
import * as JsBarcode from './JsBarcode.code128.min.js'
import JsBarcode from './JsBarcode.code128.min.js'
But the first gives a {} object, and the second makes the compiler fail with a
Error: 'default' is not exported by ./JsBarcode.code128.min.js
.What's the best way to go about that ?
I'm using Rollup.js to bundle everything into a single file.
The text was updated successfully, but these errors were encountered: