Laravel (Vue.js) - How to remove unused JavaScript from imported library?

Viewed 1007

I want to optimize my JavaScript file, I have about 50% unused code in file. A lot of this is from THREE.js library

In Vue.js view I use just few functions from THREE.js library.

import {Scene, Color, PerspectiveCamera, TextureLoader, WebGLRenderer, DirectionalLight, ImageUtils, MeshLambertMaterial, PlaneGeometry, Clock, Mesh} from 'three';

But It seems that the page loads whole THREE.js library, but I want just code that I imported. Do you have any idea how to achieve this? And give me some hints on JavaScript size optimalization. Thanks!

0 Answers
Related