@slynova/symfony-encore
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

AdonisJS - Symfony Encore

This package wraps Symfony Encore 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.

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

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

$ 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, you can use the two helpers encoreLink and encoreScript in your Edge templates.

<!DOCTYPE html>
<html lang="en">
  <head>
    {{-- Styling --}}
    {{{ encoreLink('css/app') }}}

    {{-- Scripting --}}
    {{{ encoreScript('js/app') }}}
  </head>
  <body>
    {{-- .... --}}
  </body>
</html>

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

Package Sidebar

Install

npm i @slynova/symfony-encore

Weekly Downloads

2

Version

0.3.1

License

MIT

Unpacked Size

12.2 kB

Total Files

9

Last publish

Collaborators

  • romainlanz