intlify / bundle-tools

bundling for intlify i18n tools
MIT License
232 stars 37 forks source link

Support SSR (Vite) #78

Open oyed opened 2 years ago

oyed commented 2 years ago

Clear and concise description of the problem

Currently attempted to use the Vite loader with vue-ssr results in an error:

[vite] Internal server error: Cannot find module '@intlify/vite-plugin-vue-i18n/messages' imported from 'x'

Suggested solution

I'm not sure what the issue is (I've no idea how the virtual import stuff from Vite works)

Alternative

No response

Additional context

No response

Validations

oyed commented 2 years ago

Related to #2

marekvospel commented 2 years ago

Same issue, when not using @intlify/vite-plugin-vue-i18n/messages You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle. warning is printed to console, so it looks like the plugin isn't used at all.

geewhizbang commented 2 years ago

I have this message in my project as well, anything I've tried from dozens of suggestions does not work.