I would like to compile the Bootstrap source bootstrap.min.js
to exclude unused Javascript plugins in order to reduce the KB size of the file, and create a new file containing only the used plugins.
Let s say i currently, only use offcanvas.js
and dropdown.js
: how can i remove all js modules (alert.js, button.js, carousel.js, toast.js and all others) from the botstrap.min.js
file, and remain in it only offcanvas.js and dropdown.js?
Bootstrap suggest two ways Lean JavaScript or Webpack and bundler, but I failed to apply them. I believe the mechanism is the same as SASS compiling the SCSS file to CSS (which i did fine correctly), or maybe not, but for the Javascript i fail.
My idea (i don t know if it s good, maybe there are other best ways) is to create a file where i only import offcanvas.js and dropdown.js. Next compile it and then create my.bootstrap.min.js
Can anyone show me a practical example please? Thank you all for help!!!