Avoiding node_modules in final build #1781
-
❓QuestionFirst of all, thank you very much for your amazing work. I'm using razzle within an ASP.NET Core 5 (Jering.Javascript.NodeJS for ssr) app and it works pretty fine but there is something that I'd like to improve. Using Docker I need to copy
The app wasn't working before copying the Is there a way to build server bundle to avoid copying Thank you very much. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
You can do it like this https://github.com/fivethreeo/razzle-with-docker-nginx/blob/master/Dockerfile or bundle everything with buildType iso-serverless in razzle options |
Beta Was this translation helpful? Give feedback.
-
If using express https://github.com/jaredpalmer/razzle/tree/master/examples/basic-serverless |
Beta Was this translation helpful? Give feedback.
-
Make sure react is imported in the server entrypoint so it is not dynamically imported |
Beta Was this translation helpful? Give feedback.
-
@fivethreeo not working for me too many errors like this
how to build server with node modules ? |
Beta Was this translation helpful? Give feedback.
-
https://razzlejs.org/docs/customization#transpilation-of-external-modules |
Beta Was this translation helpful? Give feedback.
You can do it like this https://github.com/fivethreeo/razzle-with-docker-nginx/blob/master/Dockerfile
or bundle everything with buildType iso-serverless in razzle options