intlify / bundle-tools

bundling for intlify i18n tools
MIT License
244 stars 36 forks source link

Support SSR (Vite) #78

Open devlsh opened 2 years ago

devlsh 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

devlsh 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.