In this lesson I show how to use webpack to code split based on route in VueJS. Code splitting is a useful tool to help eliminate unused code and only load what's necessary.
Additional Resources https://router.vuejs.org/en/advanced/lazy-loading.html
In addition to this, I had to add chunkFilename: '[name].js'
to the webpack conf. output { }
object to take advantage of the webpackChunkName
comments.
In addition to this, I had to add
chunkFilename: '[name].js'
to the webpack conf.output { }
object to take advantage of thewebpackChunkName
comments.
Did you start your project using Vue CLI 3? I wonder if that's the case. I didn't have to add anything else to get it to work. 🤔