matejsvajger / laravel-mix-pug

Laravel Mix Plugin for compiling Pug/Jade templates.
MIT License
21 stars 23 forks source link

Folders when compiling #6

Closed GeometryRamiroGarcia closed 5 years ago

GeometryRamiroGarcia commented 6 years ago

If I execute the command npm run dev as well

resources/assets/pug/welcome.pug

mix.pug('resources/assets/pug/*.pug', 'resources/views/', {
      ext: '.blade.php',
      exludePath: 'resources/assets/pug/'
});

work and generate

resources/views/welcome.balde.php


But If I execute the command npm run dev as well whit folder

resources/assets/pug/welcome.pug resources/assets/pug/layouts/app.pug

mix.pug('resources/assets/pug/*/*.pug', 'resources/views/', {
      ext: '.blade.php',
      exludePath: 'resources/assets/pug/'
});

don't work

generate resources/views/welcome.balde.php

no generate resources/views/layout/app.balde.php

matejsvajger commented 6 years ago

Try using a recursive glob syntax in your source folder:

mix.pug('resources/assets/pug/**/*.pug', 'resources/views/', {
      ext: '.blade.php',
      exludePath: 'resources/assets/pug/'
});
indigoram89old commented 5 years ago

Hello! Can you change exludePath to excludePath in readme? Thank you!

sadeghbarati commented 4 years ago

same thing and same code got this error: 👇

Pug Compilation Failed!

Error: ENOENT: no such file or directory, open 'D:\Code\laravelm\resources\markup\resources\views\index.pug'

Pug Compilation Failed!

Error: ENOENT: no such file or directory, open 'D:\Code\laravelm\resources\markup\layout-blocks\resources\views\layout_sign.pug'

Pug Compilation Failed!

Error: ENOENT: no such file or directory, open 'D:\Code\laravelm\resources\markup\layout-blocks\resources\views\layout.pug'

Pug Compilation Failed!

Error: ENOENT: no such file or directory, open 'D:\Code\laravelm\resources\markup\sign\resources\views\signin_form.pug'

Pug Compilation Failed!

Error: ENOENT: no such file or directory, open 'D:\Code\laravelm\resources\markup\sign\resources\views\signup_form.pug'  

Pug Compilation Failed!

Error: ENOENT: no such file or directory, open 'D:\Code\laravelm\resources\markup\resources\views\signin.pug'

Pug Compilation Failed!

Error: ENOENT: no such file or directory, open 'D:\Code\laravelm\resources\markup\resources\views\signup.pug'
internal/fs/utils.js:230
    throw err;
    ^

Error: ENOENT: no such file or directory, stat 'D:\Code\laravelm\resources\markup\layout-blocks\resources\views\layout.pug'
    at Object.statSync (fs.js:932:3)
    at Object.statSync (D:\Code\laravelm\node_modules\graceful-fs\polyfills.js:308:16)
    at File.size (D:\Code\laravelm\node_modules\laravel-mix\src\File.js:33:19)
    at Object.size (D:\Code\laravelm\node_modules\laravel-mix\src\webpackPlugins\CustomTasksPlugin.js:43:35)
    at D:\Code\laravelm\node_modules\webpack\lib\Stats.js:415:20
    at Array.map (<anonymous>)
    at Stats.toJson (D:\Code\laravelm\node_modules\webpack\lib\Stats.js:412:6)
    at Stats.toString (D:\Code\laravelm\node_modules\webpack\lib\Stats.js:857:20)
    at compilerCallback (D:\Code\laravelm\node_modules\webpack-cli\bin\cli.js:333:32)
    at D:\Code\laravelm\node_modules\webpack-cli\bin\cli.js:359:7
    at finalCallback (D:\Code\laravelm\node_modules\webpack\lib\Compiler.js:257:39)
    at D:\Code\laravelm\node_modules\webpack\lib\Compiler.js:306:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\Code\laravelm\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:58:1)
    at AsyncSeriesHook.lazyCompileHook (D:\Code\laravelm\node_modules\tapable\lib\Hook.js:154:20)
    at D:\Code\laravelm\node_modules\webpack\lib\Compiler.js:304:22
    at Compiler.emitRecords (D:\Code\laravelm\node_modules\webpack\lib\Compiler.js:499:39)
    at D:\Code\laravelm\node_modules\webpack\lib\Compiler.js:298:10
    at D:\Code\laravelm\node_modules\webpack\lib\Compiler.js:485:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\Code\laravelm\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:18:1)
    at AsyncSeriesHook.lazyCompileHook (D:\Code\laravelm\node_modules\tapable\lib\Hook.js:154:20)
    at D:\Code\laravelm\node_modules\webpack\lib\Compiler.js:482:27
    at D:\Code\laravelm\node_modules\neo-async\async.js:2818:7
    at done (D:\Code\laravelm\node_modules\neo-async\async.js:3522:9)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\Code\laravelm\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:4:1)
    at D:\Code\laravelm\node_modules\webpack\lib\Compiler.js:464:33
    at D:\Code\laravelm\node_modules\graceful-fs\graceful-fs.js:61:14