Package Data | |
---|---|
Maintainer Username: | iulyanp |
Maintainer Contact: | iulyanpopa@gmail.com (Iulian Popa) |
Package Create Date: | 2017-01-15 |
Package Last Update: | 2021-06-18 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-10 15:03:50 |
Package Statistics | |
---|---|
Total Downloads: | 16,437 |
Monthly Downloads: | 3 |
Daily Downloads: | 0 |
Total Stars: | 9 |
Total Watchers: | 3 |
Total Forks: | 1 |
Total Open Issues: | 0 |
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.
Before you start installing this bundle you first have to ensure that Node.js and NPM are installed on your machine.
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:
$ composer require iulyanp/elixir-mix-bundle
Else you can go with:
$ php composer.phar require iulyanp/elixir-mix-bundle
Register the bundle in the app/AppKernel.php file of your project:
<?php
/** app/AppKernel.php */
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Iulyanp\ElixirMixBundle\IulyanpElixirMixBundle(),
);
}
}
In order to be able to use the bundle you have to give it some configuration specific to your application.
# 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.
If you already have installed Node.js
, npm
you should be all set to run:
$ php bin/console mix:init
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.
Now you can use mix() function to version a file like this:
<link rel="stylesheet" type="text/css" href="{{ mix('css/app.css') }}" />
You can find more about laravel mix usage on the official documentation
The ElixirMixBundle is open-sourced software licensed under the MIT license.