SyntaxStudy
Sign Up
jQuery jQuery Slim and Module Builds
jQuery Intermediate 3 min read

jQuery Slim and Module Builds

Slim Build

jQuery Slim removes ajax and effects modules — ~6KB smaller. For modern projects, consider importing only needed jQuery modules.

Example
<!-- Standard (90KB min, 30KB gzip) -->
<script src="jquery.min.js"></script>
<!-- Slim (70KB min, 24KB gzip) — no AJAX, no animate() -->
<script src="jquery.slim.min.js"></script>
<!-- npm modular approach -->
import $ from "jquery/src/jquery"; // full
import "jquery/src/core";          // or pick modules:
import "jquery/src/selector";
import "jquery/src/traversing";
import "jquery/src/manipulation";
Pro Tip

jQuery slim is perfect when you use Bootstrap 5 (which only needs jQuery for legacy) but handle AJAX separately.