S
S
Sergey Khlopov2019-10-16 15:02:16
webpack
Sergey Khlopov, 2019-10-16 15:02:16

How to separate libraries in app.js so that the size becomes smaller?

Hello, I have a file app.jswith the following content:

import axios from 'axios';
import Vue from 'vue';

import VueApp from './components/app';
import {router} from './routes/route';
import store from './store/store';

Vue.component('vue-spinner',require('./components/admin/preloader/vue-spinner').default);
Vue.component('vue-line-loader',require('./components/admin/preloader/vue-line-loader').default);
Vue.component('vue-messages',require('./components/admin/vue-messages').default);

Vue.prototype.$axios = axios;

const app = new Vue({
    el: '#app',
    components: {VueApp},
    data: {showLoader: false},
    store,
    router,
});
Vue.directive('focus', {
    componentUpdated: function (el) {el.focus()}
});

Its uncompressed size is 530 KB, I would like it to be even smaller, please tell me what can be done to make it smaller? Thank you in advance for your response.
PS I am making a project on a framework laravel, I also use:vue.js, vuex, vue-route

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question