diff --git a/README.md b/README.md index 3c5818e..7ba6700 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# laravel-mix-pug +# laravel-mix-pug-recursive Laravel Mix Plugin for compiling Pug/Jade templates.
@@ -9,24 +9,24 @@ Laravel Mix Plugin for compiling Pug/Jade templates.
## Introduction
-This package provides a plugin for Laravel Mix to compile pug templates. `laravel-mix-pug` requires Laravel Mix to work. Please follow the instructions on how to use it on the package [repository](https://github.com/JeffreyWay/laravel-mix).
+This package provides a plugin for Laravel Mix to compile pug templates. `laravel-mix-pug-recursive` requires Laravel Mix to work. Please follow the instructions on how to use it on the package [repository](https://github.com/JeffreyWay/laravel-mix).
## Usage
Install this package into your project:
```
-npm install laravel-mix-pug --save-dev
+npm install laravel-mix-pug-recursive --save-dev
```
Head over to your `webpack.mix.js` and register it on the Laravel Mix API:
```js
let mix = require('laravel-mix');
-mix.pug = require('laravel-mix-pug');
+mix.pug = require('laravel-mix-pug-recursive');
mix.js('src/app.js', 'dist')
.sass('src/app.scss', 'dist')
- .pug('src/*.pug', 'dist')
+ .pug('src/**/*.pug', 'dist')
.setPublicPath('dist');
```
@@ -37,7 +37,7 @@ You can also pass in a third optional parameter: *options* object. It accepts tw
This is a path to a folder with seed files. Files can be of type `json` or `yaml`. They will be parsed and provided in your pug template locals under the seed file name and then contents.
```js
-mix.pug('src/*.pug', 'dist', {seeds:'src/seeds'});
+mix.pug('src/**/*.pug', 'dist', {seeds:'src/seeds'});
```
And if you have a file `demo.yml` in there all the content will be available in your template under
@@ -50,7 +50,7 @@ a(href=seed.demo.anchor.link) seed.demo.anchor.name
It's possible to pass in an object which will be added to locals in your pug templates:
```js
-mix.pug('src/*.pug', 'dist', {
+mix.pug('src/**/*.pug', 'dist', {
locals: {
config: { baseUrl: 'http://my-template.dev/' }
}
@@ -68,7 +68,7 @@ script(src=`{config.baseUrl}js/main.js`)
You can pass in [pug config options](https://pugjs.org/api/reference.html#options) under `pug` key:
```js
-mix.pug('src/*.pug', 'dist', {
+mix.pug('src/**/*.pug', 'dist', {
pug: {
pretty: true,
debug: true
@@ -81,7 +81,7 @@ It is possible to change to output file extension and exclude part of the path.
i.e.: You want your destination file to be in `resources/assets/views` and the folder structure in there to continue from the `resources/assets/pug/{..}`:
```js
-mix.pug('resources/assets/pug/*.pug', 'resources/assets/views', {
+mix.pug('resources/assets/pug/**/*.pug', 'resources/assets/views', {
ext: '.blade.php',
excludePath: 'resources/assets/pug'
});
diff --git a/package.json b/package.json
index e6a37b6..2094ecc 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
- "name": "laravel-mix-pug",
- "version": "0.3.0",
+ "name": "laravel-mix-pug-recursive",
+ "version": "0.3.6",
"description": "Laravel Mix Plugin for compiling Pug/Jade templates.",
"main": "src/index.js",
"scripts": {
@@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
- "url": "git+https://github.com/matejsvajger/laravel-mix-pug.git"
+ "url": "git+https://github.com/mikemartin/laravel-mix-pug-recursive.git"
},
"keywords": [
"laravel",
@@ -18,15 +18,16 @@
"author": "Matej Svajger