2017 © Pedro Peláez
 

symfony-bundle elixir-mix-bundle

A Symfony bundle that integrates Laravel Mix

image

iulyanp/elixir-mix-bundle

A Symfony bundle that integrates Laravel Mix

  • Tuesday, January 23, 2018
  • by iulyanp
  • Repository
  • 2 Watchers
  • 3 Stars
  • 3,780 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 10 Versions
  • 29 % Grown

The README.md

Build Status Scrutinizer Code Quality, (*1)

ElixirMixBundle

Note! Starting with Symfony 4 you can use the official webpack wrapper from Symfony: Encore. I also wrote a short blog post about how you can Compile your assets with Symfony Encore., (*2)

ElixirMixBundle is a Symfony bundle that integrates Laravel Mix. The purpose of the bundle is to offer the mix() twig function. This is exactly the same mix() function from Laravel blade template system., (*3)

Requirements

Before you start installing this bundle you first have to ensure that Node.js and NPM are installed on your machine., (*4)

Installation

Step 1: Require the bundle with composer

Open your terminal and run one of the following commands to download the bundle into your vendor directory., (*5)

If you have composer installed globally you can run:, (*6)

$ composer require iulyanp/elixir-mix-bundle

Else you can go with:, (*7)

$ php composer.phar require iulyanp/elixir-mix-bundle

Step 2: Register the bundle in your AppKernel class

Register the bundle in the app/AppKernel.php file of your project:, (*8)

<?php
/** app/AppKernel.php */

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(

            new Iulyanp\ElixirMixBundle\IulyanpElixirMixBundle(),
        );
    }
}

Step 3: Configure the bundle

In order to be able to use the bundle you have to give it some configuration specific to your application., (*9)

# config/parameters.yml
parameters:
    # ...
    web_dir: "%kernel.root_dir%/../web"

# config/config.yml
iulyanp_elixir_mix:
    web_dir: "%web_dir%"

The web_dir configuration is just the public path where you want the output for your assets to be saved. I used web directory from Symfony., (*10)

Step 4: Initialize larave-mix package

If you already have installed Node.js, npm you should be all set to run:, (*11)

$ php bin/console mix:init

A base package.json and webpack.mix.js file will be generated into your project root directory., (*12)

Then run npm install to install all the dependencies and laravel-mix., (*13)

Usage

Now you can use mix() function to version a file like this:, (*14)

<link rel="stylesheet" type="text/css" href="{{ mix('css/app.css') }}" />

You can find more about laravel mix usage on the official documentation, (*15)

License

The ElixirMixBundle is open-sourced software licensed under the MIT license., (*16)

The Versions

23/01 2018

dev-analysis-XZ44JP

dev-analysis-XZ44JP

A Symfony bundle that integrates Laravel Mix

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

symfony3 elixir laravel-mix mix bundle symfony mix symfony mix bundle

23/01 2018

dev-analysis-XNQQjL

dev-analysis-XNQQjL

A Symfony bundle that integrates Laravel Mix

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

symfony3 elixir laravel-mix mix bundle symfony mix symfony mix bundle

16/06 2017

dev-master

9999999-dev

A Symfony bundle that integrates Laravel Mix

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

symfony3 elixir laravel-mix mix bundle symfony mix symfony mix bundle

21/05 2017

v0.6.0

0.6.0.0

A Symfony bundle that integrates Laravel Mix

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

symfony3 elixir laravel-mix mix bundle symfony mix symfony mix bundle

19/03 2017

v0.5.0

0.5.0.0

A Symfony bundle that integrates Laravel Mix

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

symfony3 elixir laravel-mix mix bundle symfony mix symfony mix bundle

04/02 2017

v0.4.0

0.4.0.0

A Symfony bundle that integrates Laravel Mix

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

symfony3 elixir laravel-mix mix bundle symfony mix symfony mix bundle

19/01 2017

v0.3.0

0.3.0.0

A Symfony bundle that integrates Laravel Mix

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

symfony3 elixir laravel-mix mix bundle symfony mix symfony mix bundle

19/01 2017

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

A Symfony bundle that integrates Laravel Mix

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

symfony3 elixir laravel-mix mix bundle symfony mix symfony mix bundle

15/01 2017

v0.2.0

0.2.0.0

A Symfony bundle that integrates Laravel Mix

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

symfony3 elixir laravel-mix mix bundle symfony mix symfony mix bundle

15/01 2017

v0.1.0

0.1.0.0

A Symfony bundle that integrates Laravel Mix

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

symfony3 elixir laravel-mix mix bundle symfony mix symfony mix bundle