Sign in
Log inSign up

Vue code splitting in Laravel

Emil Moe's photo
Emil Moe
·Mar 29, 2018

I'm struggling to figure out how this code splitting works. As of now the JS file has become way too big and code splitting is a must. I saw Evan You writing this in a presentation:

const Component = () => import('./Component.vut')

But Webpack won't let me compile that.

I'm importing my components as

Vue.component('Component', require('./Component.vue'))

Hope some of you can help me out here :-)