An open API service indexing awesome lists of open source software.

https://github.com/slynova-org/symfony-encore

Wrapper of Symfony Encore for AdonisJS
https://github.com/slynova-org/symfony-encore

adonisjs frontend hacktoberfest symfony-encore webpack

Last synced: about 1 year ago
JSON representation

Wrapper of Symfony Encore for AdonisJS

Awesome Lists containing this project

README

          

# AdonisJS - Symfony Encore

This package wraps [Symfony Encore](https://symfony.com/doc/current/frontend.html) to make it work seamlessly with AdonisJS.

## Getting Started

This package is available in the npm registry. It can easily be installed with `npm` or `yarn`.

```bash
$ npm i @slynova/symfony-encore
# or
$ yarn add @slynova/symfony-encore
```

Then, you need to scaffold the package using the `node ace invoke` command.

```bash
$ node ace invoke @slynova/symfony-encore
```

Doing so will install `@symfony/webpack-encore` directly in your application, create a boilerplate configuration and setup few scripts in your `package.json` to build your assets.

## How to Use

After tweaking the configuration [according to the documentation](https://symfony.com/doc/current/frontend.html), you can use the two helpers `encoreLink` and `encoreScript` in your Edge templates.

```html


{{-- Styling --}}
{{{ encoreLink('css/app') }}}

{{-- Scripting --}}
{{{ encoreScript('js/app') }}}


{{-- .... --}}

```

The parameter given to those helpers is the entry path you gave in your configuration.