L
L
Lawrence2021-11-30 11:50:45
Vue.js
Lawrence, 2021-11-30 11:50:45

How to correctly connect (separate) the final JS for two different components?

Probably a strange question, I apologize right away, but I just have not come across this before.
I have always used VUE for SPA and SSR (mostly nuxt) applications that were entirely powered by Vue. Now you need to use VUE on one or two separate pages (when working with nuxt, I didn’t know any problems and didn’t even think about it, the necessary component and code were loaded depending on the route.)

Roughly speaking, there is a third-party project where you need to develop two completely different (not dependent on each other) components that are on different pages. Design templates are separated by these pages and it is possible to connect scripts and styles only to them (to these pages).

I assembled the assembly with vue and smashed all my tasks into different components.
But the final bundle is the same. As is usually done for such purposes.

Do two different builds for each component?
Or include one large js file both there and there?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question