<commit_before># Laravel Elixir

- [Introduction](#introduction)
- [Installation & Setup](#installation)
- [Usage](#usage)
- [Gulp](#gulp)
- [Directory Defaults](#defaults)
- [Extensions](#extensions)

<a name="introduction"></a>
## Introduction

Laravel Elixir provides a clean, fluent API for defining basic [Gulp](http://gulpjs.com) tasks for your
Laravel application. Elixir supports several common CSS and JavaScript pre-processors, and even testing tools.

If you've ever been confused about how to get started with Gulp and asset compliation, you will love Laravel Elixir!

<a name="installation"></a>
## Installation & Setup

### Installing Node

Before triggering Elixir, you must first ensure that Node.js is installed on your machine.

    node -v

By default, Laravel Homestead includes everything you need; however, if you aren't using Vagrant, then you
can easily install Node by visiting [their download page](http://nodejs.org/download/). Don't worry, it's
quick and easy!

### Gulp

Next, you'll want to pull in [Gulp](http://gulpjs.com) as a global NPM package like so:

    npm install --global gulp

### Laravel Elixir

The only remaining step is to install Elixir! With a new install of Laravel, you'll find a `package.json` file in the root. Think of this like your `composer.json` file, except it defines Node dependencies instead of PHP. You may install the dependencies it references by running:

    npm install

<a name="usage"></a>
## Usage

Now that you've installed Elixir, you'll be compiling and concatenating in no time!

#### Compile Less

```javascript
elixir(function(mix) {
    mix.less("app.less");
});
```

In the example above, Elixir assumes that your Less files are stored in `resources/assets/less`.

#### Compile Sass

```javascript
elixir(function(mix) {
    mix.sass("app.scss");
});
```

This assumes that your Sass files are stored in `resources/assets/sass`.

#### Compile CoffeeScript

```javascript
elixir(function(mix) {
    mix.coffee();
});
```

This assumes that your CoffeeScript files are stored in `resources/assets/coffee`.

#### Compile All Less and CoffeeScript

```javascript
elixir(function(mix) {
    mix.less()
       .coffee();
});
```

#### Trigger PHPUnit Tests

```javascript
elixir(function(mix) {
    mix.phpUnit();
});
```

#### Trigger PHPSpec Tests

```javascript
elixir(function(mix) {
    mix.phpSpec();
});
```

#### Combine Stylesheets

```javascript
elixir(function(mix) {
    mix.styles([
        "normalize.css",
        "main.css"
    ]);
});
```

Paths passed to this method are relative to the `resources/css` directory.

#### Combine Stylesheets and Save to a Custom Directory

```javascript
elixir(function(mix) {
    mix.styles([
        "normalize.css",
        "main.css"
    ], 'public/build/css/everything.css');
});
```

#### Combine Stylesheets From A Custom Base Directory

```javascript
elixir(function(mix) {
    mix.styles([
        "normalize.css",
        "main.css"
    ], 'public/build/css/everything.css', 'public/js');
});
```

The third argument to both the `styles` and `scripts` methods determines the relative directory for all paths passed to the methods.

#### Combine All Styles in a Directory

```javascript
elixir(function(mix) {<commit_msg>Fix typo in mix.styles() with custom directory<commit_after># Laravel Elixir

- [Introduction](#introduction)
- [Installation & Setup](#installation)
- [Usage](#usage)
- [Gulp](#gulp)
- [Directory Defaults](#defaults)
- [Extensions](#extensions)

<a name="introduction"></a>
## Introduction

Laravel Elixir provides a clean, fluent API for defining basic [Gulp](http://gulpjs.com) tasks for your
Laravel application. Elixir supports several common CSS and JavaScript pre-processors, and even testing tools.

If you've ever been confused about how to get started with Gulp and asset compliation, you will love Laravel Elixir!

<a name="installation"></a>
## Installation & Setup

### Installing Node

Before triggering Elixir, you must first ensure that Node.js is installed on your machine.

    node -v

By default, Laravel Homestead includes everything you need; however, if you aren't using Vagrant, then you
can easily install Node by visiting [their download page](http://nodejs.org/download/). Don't worry, it's
quick and easy!

### Gulp

Next, you'll want to pull in [Gulp](http://gulpjs.com) as a global NPM package like so:

    npm install --global gulp

### Laravel Elixir

The only remaining step is to install Elixir! With a new install of Laravel, you'll find a `package.json` file in the root. Think of this like your `composer.json` file, except it defines Node dependencies instead of PHP. You may install the dependencies it references by running:

    npm install

<a name="usage"></a>
## Usage

Now that you've installed Elixir, you'll be compiling and concatenating in no time!

#### Compile Less

```javascript
elixir(function(mix) {
    mix.less("app.less");
});
```

In the example above, Elixir assumes that your Less files are stored in `resources/assets/less`.

#### Compile Sass

```javascript
elixir(function(mix) {
    mix.sass("app.scss");
});
```

This assumes that your Sass files are stored in `resources/assets/sass`.

#### Compile CoffeeScript

```javascript
elixir(function(mix) {
    mix.coffee();
});
```

This assumes that your CoffeeScript files are stored in `resources/assets/coffee`.

#### Compile All Less and CoffeeScript

```javascript
elixir(function(mix) {
    mix.less()
       .coffee();
});
```

#### Trigger PHPUnit Tests

```javascript
elixir(function(mix) {
    mix.phpUnit();
});
```

#### Trigger PHPSpec Tests

```javascript
elixir(function(mix) {
    mix.phpSpec();
});
```

#### Combine Stylesheets

```javascript
elixir(function(mix) {
    mix.styles([
        "normalize.css",
        "main.css"
    ]);
});
```

Paths passed to this method are relative to the `resources/css` directory.

#### Combine Stylesheets and Save to a Custom Directory

```javascript
elixir(function(mix) {
    mix.styles([
        "normalize.css",
        "main.css"
    ], 'public/build/css/everything.css');
});
```

#### Combine Stylesheets From A Custom Base Directory

```javascript
elixir(function(mix) {
    mix.styles([
        "normalize.css",
        "main.css"
    ], 'public/build/css/everything.css', 'public/css');
});
```

The third argument to both the `styles` and `scripts` methods determines the relative directory for all paths passed to the methods.

#### Combine All Styles in a Directory

```javascript
elixir(function(mix) {
{'fraction_non_alphanumeric': 0.13195718654434252, 'fraction_numerical': 0.0, 'mean_word_length': 4.174841772151899, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6284779', 'n_tokens_mistral': 2059, 'n_tokens_neox': 1934, 'n_words': 696}