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
- Host: GitHub
- URL: https://github.com/slynova-org/symfony-encore
- Owner: Slynova-Org
- Created: 2020-06-26T08:30:15.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-22T19:22:49.000Z (over 5 years ago)
- Last Synced: 2025-03-26T07:15:11.427Z (over 1 year ago)
- Topics: adonisjs, frontend, hacktoberfest, symfony-encore, webpack
- Language: TypeScript
- Homepage:
- Size: 391 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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.