I am using Vue.js 3
for my front end, and Node/Express on the back-end. I am trying to enable server side rendering which is proving difficult.
I understand the client-side is built into a file called app.js
. However I never see server.js
being built and exported to the dist
folder? Here are some examples:
entry-client.js
and entry-server.js
file being provided to Webpack, but server.js
is not anywhere to be seen. main.server.js
as the server entry file and does not build server.js
. It is my understanding that server.js
is the back-end and has to run for Node.js/Express to work. In the above two examples what exactly is being built from the server entry files because it doesn't seem to be server.js
where the Express routes live. Surely server.js
must be built to the dist folder so that it can be accessed and run by a web server like Windows IIS for example (which I am using)?
You are correct, usually there is no need to bundle the server code.
But there are some benefits from doing so:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.