0
votes

Can i split vue generation files via wabpack on few files. I need use login page without other component. If i have structure smth like this:

  • components
    • Login.vue
    • Home.vue
    • etc.

In the build dir i want have

  • js
    • bundle
    • login_bundle
  • css
    • main.css
    • login.css
  • index.html
  • login.html

Have webpack some ability for this?

1
Yes it does have the ability to do that. See here webpack.js.org/guides/code-splitting - skribe
I think you want to pre-render some of your routes. See github.com/chrisvfritz/prerender-spa-plugin - Vamsi Krishna

1 Answers

0
votes

Try eager importing.

const dependency = () => import(
  /* webpackChunkName: "login-chunk" */
  /* webpackMode: "eager" */
  'module in Login.vue'
).then(m => m.default || m);