PHPackages                             guave/assetload-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. guave/assetload-bundle

ActiveContao-bundle[Utility &amp; Helpers](/categories/utility)

guave/assetload-bundle
======================

Asset Load Helper and Insert Tags for Contao 5.0+

4.0.3(2mo ago)01.8k1[1 PRs](https://github.com/guavestudios/AssetLoadBundle/pulls)ISCPHPPHP ^8.1CI failing

Since Feb 7Pushed 1w ago4 watchersCompare

[ Source](https://github.com/guavestudios/AssetLoadBundle)[ Packagist](https://packagist.org/packages/guave/assetload-bundle)[ Docs](https://www.guaveinteractive.ch)[ RSS](/packages/guave-assetload-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (14)Versions (30)Used By (0)

Asset Load Bundle
=================

[](#asset-load-bundle)

This contao module allow you to load assets

Requirements
------------

[](#requirements)

- Contao 5.0+
- PHP 8.1+

Install
-------

[](#install)

```
$ composer require guave/assetload-bundle
```

Usage
-----

[](#usage)

### Load CSS and JS Files in your templates

[](#load-css-and-js-files-in-your-templates)

Requires a `entrypoints.json` file in your `files/project-name/dist` directory as follows:

```
{
    "entrypoints": {
        "project-name": {
            "css": [
                "/files/project-name/dist/project-name.css"
            ],
            "js": [
                "/files/project-name/dist/project-name.js"
            ]
        }
    }
}
```

and expects a `$GLOBALS['TL_CONFIG']['assetPath']` that contains your `files/project-name` directory

Load the assets into your templates with Twig:

```
{{ css('file-name')|raw }}
{{ js('file-name')|raw }}
```

or with PHP

```
