Skip to content

server-renderer replacement for renderStyles/renderScriptsΒ #4385

@weikinhuang

Description

@weikinhuang

Version

3.2.4

Reproduction link

https://codesandbox.io/s/optimistic-meninsky-2opkl

Steps to reproduce

Create a SSR app with vite, and instead of returning the html directly, attempt to return each rendered section.

What is expected?

Ability to get the html, css, and script blocks like in vue 2.

What is actually happening?

Only able to get the html section of the rendered content.


I'm migrating an existing vue2 app with ssr built in a special way where instead of the server returning the html directly to the user, we're instead having the node server return a json object with

{ 
  body: ...renderedapphtml...,
  assets: {
    styles: context.renderStyles(),
    scripts: context.renderScripts(),
  },
}

However in trying to move to vue3 vite, these properties are missing, and I don't see any replacement for them. Am I missing something, or is this unsupported functionality going forward?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions