wendt88's avatar

how to set output path for webpacks code splitting

Hi, i use webpacks code splitting (https://webpack.github.io/docs/code-splitting.html) for my vue routes (https://router.vuejs.org/en/advanced/lazy-loading.html).

now the problem is that webpack puts my grouped components into the "public" folder, instead of "public/js"

e.g.

Vue.component('alerts', r => { require.ensure([], () => r(require('./components/Alerts.vue')), 'global'); });

creates a file: "/public/0.app.js"

0 likes
1 reply
nachodd's avatar

hello!

i've just been dealing eith the same problem:

const Layout = resolve => {
  require.ensure(['./components/Layout.vue'], () => {
    resolve(require('./components/Layout.vue'))
  },"comps/Layout")
}

the "comps/Layout" is where you will find the component. Hope it helps.

Please or to participate in this conversation.