Code splitting example app that demonstrates creating multiple code bundles with dynamic import statements.
Example of code splitting in Vue based on computed property and dynamic components. The initial load contains the initial view and critical assets, while other modules are loaded on the button press.
- when the data changes, the computed property will re-evaluate
- dynamic component switches between the imported components after the computed property change
- default Vue CLI prefetch function is disabled in vue.config.js - components are loaded on demand, as the user navigates the application
Clone this repo to your local machine
$ git clone https://github.com/ditdot-dev/vue-code-splitting.git
npm install
npm run serve
npm run build
npm run lint
MIT license.