# friendly-laravel-mix

> This is a solution to use Laravel Mix simplified, become more fast declare your styles and scripts files.

Latest version **1.0.8** (published 2021-12-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install friendly-laravel-mix
pnpm add friendly-laravel-mix
yarn add friendly-laravel-mix
bun add friendly-laravel-mix
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-12-09 |
| First published | 2021-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | David Henderson |
| Maintainers | davidhgjs |
| Keywords | laravel, mix, helper, laravel-mix |

## Links

- npm: https://www.npmjs.com/package/friendly-laravel-mix
- Repository: https://github.com/DavidHGJ/friendly-laravel-mix
- Homepage: https://github.com/DavidHGJ/friendly-laravel-mix#readme
- Issues: https://github.com/DavidHGJ/friendly-laravel-mix/issues
- npm.io page: https://npm.io/package/friendly-laravel-mix

## Dependencies (2)

- [mz](https://npm.io/package/mz.md) ^2.7.0
- [laravel-mix](https://npm.io/package/laravel-mix.md) ^6.0.39

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.8 (latest) — 2021-12-09
- 1.0.7 — 2021-12-06
- 1.0.6 — 2021-12-02
- 1.0.5 — 2021-11-29
- 1.0.4 — 2021-11-27
- 1.0.3 — 2021-11-27
- 1.0.2 — 2021-11-27
- 1.0.1 — 2021-11-27
- 1.0.0 — 2021-11-27

## README

## Friendly Laravel Mix

### Why?
This library was created with aim simplify the use of Laravel Mix, because its was a constant problem in my work. Then thinking in good solution i create this librabry for this.

### Install
The installation is very simple, you need the npm installed in your system, if you already have installed run this code:
- npm install friendly-laravel-mix <br/>
```bash
npm install friendly-laravel-mix
```

### Starting Use
Start by calling the module <br/>
```js
const Friendly = require('friendly-laravel-mix')
```

### Defining new path to use <br/>
```js
Friendly.addFolder('foo', 'resources/js', 'public/js')
```
<br/>
The first parameter is a name you use to call the path. <br/>
The second parameter is path to folder where you save yours styles and scripts files. <br/>
The third parameter is optional and is the destiny path where you will save your copiled styles and scripts.

### Defining files
Now you just need to call the method. <br/>
```js
 Friendly.foo.scripts('script-1')
 Friendly.foo.js('script-2')
```
#### OBS:
-The default location to save your copiled file is folder 'public/your-defined-folder' but if you need to change this call the method setDestiny('path-to-destiny') before defining yours folders path, look the example below: <br/>
```js
Friendly.setDestiny('public/assets')
```
### Available Methods

#### Folder methods
- After define your paths the available methods is:
  - scripts(js-file-name); //Similar use to Laravel Mix
    ```js
    Friendly.foo.scripts('file-name')
    ```
  - js(js-file-name); //Similar use to Laravel Mix
    ```js
    Friendly.foo.js('file-name')
    ```
  - sass(sass-file-name); //Similar use to Laravel Mix
    ```js
    Friendly.foo.sass('file-name')
    ```
  - scss(scss-file-name); //Similar use to sass method in Laravel Mix
    ```js
    Friendly.foo.scss('file-name')
    ```
  - vue('js-file-name'); //Similar use to js method but this method add .vue in js file.
    ```js
    Friendly.foo.vue('file-name') // equivalent to mix.js().vue
    ```
    
(you don't need to pass the file extension)

#### Class methods
- version() // Similar use to Laravel Mix
```js
Friendly.version()
```

-getMix() // Return Laravel Mix instance
```js
Friendly.getMix()

//Use example
Friendly.getMix().webpackConfig({...})
```

---
_Source: https://npm.io/package/friendly-laravel-mix · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
