Closed hmaesta closed 3 years ago
@hmaesta sure, you totally can. Just add .cjs
at the end of your import path. I created this repo so you can take a look: https://github.com/cibernox/svelte-precompile-with-rollup-app
It worked and I just saved 100 kb. 🙌
Thanks for the patience, Miguel. Have a nice week.
wow, 100k of savings is a lot. How many translations does your app have?
Not so much, to be honest. Around 100 lines – but a lot with singular/plural variations. The biggest problem was:
file:
/node_modules/@formatjs/icu-messageformat-parser/lib/parser.js
original size:48.151 KB
Cool, let me know if you find anything that doesn't work. I for instance I'm aware that ordinals (1st, 2nd, 3rd) might not work yet, but afaik everything else should be working.
Hello Miguel, Thank you for your effort to improve i18n on Svelte.
I am currently using
svelte-i18n
and a good part of our bundle is theicu-messageformat-parser
. I tried to installsvelte-intl-precompile
, but failed.My
rollup.config.js
:I am getting:
Is it possible to use with Rollup?