nalgeon/iuliia-js

Import only demand schema. For smaller vendor size.

adinvadim opened this issue · 4 comments

For example:
import iuliia from "iuliia";
import ICAO_DOC_9303 from 'iuliia/schemas/ICAO_DOC_9303';
iuliia.translate("Юлия Щеглова", ICAO_DOC_9303);

Unfortunately, my JS bundling skills are close to non-existing. You are welcome to send a PR though.

Done in 0.7.0 for mosmetro and yandex_money schemas.

I created a PR which compiles iuliia to ESM, which can be easily optimized by Webpack with tree-shaking on. #26

Now iuliia@0.8.2 can be tree-shaked in your project with any modern bundler.

For webpack the following options should be set in config:

    optimization: {
        innerGraph: true,
        usedExports: true,
    }