Skip to content

Implement SSR mode (server side rendering) #1034

@gijsroge

Description

@gijsroge

What problem does this feature solve?

By default vue-cli-service uses commonChunksPlugin. But when using vue-server-renderer it expect one entry file. So commonChunksPlugin should be disabled.

Building for production...(node:77282) UnhandledPromiseRejectionWarning: Error: Server-side bundle should have one single entry file. Avoid using CommonsChunkPlugin in the server config.
    at Compiler.<anonymous> (/Users/gijs.roge/Sites/opcafegaannew/prototypes/premium-page/node_modules/vue-server-renderer/server-plugin.js:58:13)
    at next (/Users/gijs.roge/Sites/opcafegaannew/prototypes/premium-page/node_modules/@vue/cli-service/node_modules/tapable/lib/Tapable.js:204:14)
    at callback (/Users/gijs.roge/Sites/opcafegaannew/prototypes/premium-page/node_modules/copy-webpack-plugin/dist/index.js:77:17)
    at /Users/gijs.roge/Sites/opcafegaannew/prototypes/premium-page/node_modules/copy-webpack-plugin/dist/index.js:118:24
    at <anonymous>

What does the proposed API look like?

$ vue-cli-service build --mode server

Internally this should disable commonChunksPlugin and also set NODE_ENV to "server".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions