Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Jquery Bundle

Jquery Bundle Laravel Package

schokri/jquery-bundle

SchokriJqueryBundle integrates jQuery into Symfony applications, streamlining asset inclusion and template usage. It helps manage jQuery and related front-end dependencies consistently, making it easier to add interactive behavior without manual script wiring.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Jquery Bundle
How do I install Schokri jQuery Bundle with Composer?
Run composer require schokri/jquery-bundle in your Symfony project. Then register the bundle: with Symfony Flex it is usually added to config/bundles.php automatically, otherwise enable it in your AppKernel or bundles.php manually. After that, the packaged jQuery asset is available to your templates.
Does Schokri jQuery Bundle work with Laravel?
No. This is a Symfony bundle and relies on Symfony's bundle registration and asset/Twig workflow, so it is not a drop-in Laravel package. Laravel projects should use npm, Laravel Mix/Vite, or a Laravel-specific jQuery package instead. The Composer name alone does not make it framework-agnostic.
How do I include jQuery in a Twig template after installing the bundle?
Reference the bundled asset with Twig's asset() function, typically pointing at the bundle's public resources path, for example a script tag using asset('bundles/schokrijquery/js/jquery.min.js'). Place it before your own scripts so $ is defined. Confirm the exact filename and path in the repository, since bundle resource paths vary.
Do I need to configure anything after registering the bundle?
In most cases setup is minimal: register the bundle, then render the jQuery script tag in your layout. The overview describes simple registration and configuration with no heavy options. If you need custom asset paths or a specific jQuery build, check the bundle's configuration and resources directly.
Which Symfony versions does this bundle support?
The provided overview does not pin a Symfony version range, so check the bundle's composer.json for the exact constraint before installing. Bundles of this style often target older Symfony releases, so verify compatibility if you are on Symfony 6 or 7. Running composer why-not or composer update in a test branch is a quick way to confirm.
How do the jQuery assets get into my public web directory?
Symfony bundles expose assets under their Resources/public directory, which are referenced through the bundles/<bundle-name>/ URL prefix. On older Symfony setups you may need to run assets:install (or use a symlink) to publish them to web/. Verify the resulting path matches the one used in your Twig asset() call.
Is this bundle a good replacement for a jQuery CDN in production?
Yes, that is its main purpose: it serves jQuery from your own application instead of an external CDN. Local delivery means no third-party request and a version that is locked with your codebase. You still need to handle caching headers, minification, and asset versioning through your normal Symfony asset pipeline.
How do I upgrade the bundled jQuery version?
Because jQuery is packaged inside the bundle, updating it means updating the bundle dependency or replacing the asset file in the bundle's resources. Check the repository releases for a version that ships the jQuery build you need. Avoid mixing a manually replaced file with a Composer-managed bundle, since updates will overwrite it.
Does Schokri jQuery Bundle work with Symfony Flex and bundles.php?
Symfony Flex can auto-register bundles that declare the right recipe or type, but this bundle's Flex support depends on its composer.json and recipe availability. If it is not auto-enabled, add it manually to config/bundles.php. Flex does not change how the bundled assets are referenced in Twig.
What are the alternatives to this bundle for adding jQuery in Symfony?
Common alternatives are installing jquery via npm and bundling it with Webpack Encore or AssetMapper, or using Symfony's asset mapper with an importmap. Those approaches integrate better with modern Symfony frontend tooling and version management. This bundle is most useful for legacy or jQuery-heavy projects that want a quick local asset without a build step.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console