Download the PHP package iulyanp/elixir-mix-bundle without Composer
On this page you can find all versions of the php package iulyanp/elixir-mix-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download iulyanp/elixir-mix-bundle
More information about iulyanp/elixir-mix-bundle
Files in iulyanp/elixir-mix-bundle
Package elixir-mix-bundle
Short Description A Symfony bundle that integrates Laravel Mix
License MIT
Informations about the package elixir-mix-bundle
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.
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.
Requirements
Before you start installing this bundle you first have to ensure that Node.js and NPM are installed on your machine.
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.
If you have composer installed globally you can run:
Else you can go with:
Step 2: Register the bundle in your AppKernel class
Register the bundle in the app/AppKernel.php file of your project:
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.
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.
Step 4: Initialize larave-mix package
If you already have installed Node.js
, npm
you should be all set to run:
A base package.json
and webpack.mix.js
file will be generated into your project root directory.
Then run npm install
to install all the dependencies and laravel-mix.
Usage
Now you can use mix() function to version a file like this:
You can find more about laravel mix usage on the official documentation
License
The ElixirMixBundle is open-sourced software licensed under the MIT license.