V
V
Vladimir2020-11-30 12:20:43
Vue.js
Vladimir, 2020-11-30 12:20:43

How to separate front and back code in one VUE project?

I do not want one bundle to be used for both the client side and the admin side. At the same time, css wants to have the same. How can I specify that a particular template should not go into the general bundle? Or is it easier to do 2 parallel projects?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2020-11-30
@Cosss

If you use the asynchronous syntax for the router, then by default the webpack will cut into bundles as it should:
https://router.vuejs.org/en/guide/advanced/lazy-lo...
for example:

const routes = [
  {
    name: 'index',
    path: '/',
    component: () => import('Index.vue'),
  },
  {
    name: 'test',
    path: '/test',
    component: () => import('Test.vue'),
  },

]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question