nalgeon / iuliia-js

Transliterate Cyrillic → Latin in every possible way
https://iuliia.ru
MIT License
82 stars 7 forks source link

Import only demand schema. For smaller vendor size. #2

Closed adinvadim closed 2 years ago

adinvadim commented 4 years ago

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

nalgeon commented 4 years ago

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

nalgeon commented 2 years ago

Done in 0.7.0 for mosmetro and yandex_money schemas.

corporateanon commented 2 years ago

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

corporateanon commented 2 years ago

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,
    }