jinsonjose
1 week ago
175
7
Vue

how reduce size of app.js and vendor.js or how to split vendor to different chunks

Posted 1 week ago by jinsonjose

in production its size shows big and take time on loading how to reduce size of this files

in webpack.mix.js

mix.js('resources/js/app.js', 'public/js') .sass('resources/sass/app.scss', 'public/css').extract();

extracted to seperated files

vendor.js files size is 2.04mb how can i reduce the size

it shows affect the speed

package.json file below

{ "private": true, "scripts": { "dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "npm run development -- --watch", "watch-poll": "npm run watch -- --watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { "axios": "^0.19.2", "bootstrap": "^4.5.0", "cross-env": "^5.1", "jquery": "^3.5.1", "laravel-mix": "^4.0.7", "lodash": "^4.17.19", "popper.js": "^1.16.1", "resolve-url-loader": "^2.3.1", "sass": "^1.26.10", "sass-loader": "7.*", "vue": "^2.6.11", "vue-template-compiler": "^2.6.10" }, "dependencies": { "bootstrap-vue": "^2.15.0", "chart.js": "^2.9.3", "jspdf": "^2.1.1", "jspdf-autotable": "^3.5.12", "leaflet": "^1.6.0", "moment": "^2.27.0", "run": "^1.4.0", "sweetalert2": "^9.15.3", "v-calendar": "^1.0.8", "vform": "^1.0.1", "vue-css-donut-chart": "^1.3.0", "vue-google-charts": "^0.3.3", "vue-loading-overlay": "^3.3.2", "vue-plain-pagination": "^0.3.0", "vue-router": "^3.3.4", "vue-search-select": "^2.9.3", "vue-sweet-calendar": "^0.3.1", "vue2-datepicker": "^3.6.0", "vue2-leaflet": "^2.5.2", "vue2-leaflet-markercluster": "^3.1.0" } }

Please sign in or create an account to participate in this conversation.