Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

SSR optimization logic on runtime. #71

Open
serkanyersen opened this issue May 29, 2018 · 1 comment
Open

SSR optimization logic on runtime. #71

serkanyersen opened this issue May 29, 2018 · 1 comment

Comments

@serkanyersen
Copy link

Hi there.

I'm currently using vue-component-compiler on a custom bundler I wrote. We have an internal Vue component library and we need to bundle each component separately instead of bundling everything into a single file.

I got everything else working but I'm having trouble with the SSR optimizations. As far as I understand I can only compile for SSR or CLIENT but not both at the same time.

Would it be possible to get a compiled component decide what to do on runtime? Right now SSR related pieces in the code just prints if(true). I feel like if I could get it to print if(process.env.VUE_ENV === 'server') instead, it might just work.

I'm also open to other suggestions for 1:1 mapping of .vue files to compiled .js versions.

Thank you for great work!

@znck
Copy link
Member

znck commented May 30, 2018

It is possible to use @vue/component-compiler-utils, it is a lower level utility.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants