mikemartin / laravel-mix-pug-recursive

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

compiled pug files are placed at the wrong address #2

Closed devellopah closed 3 years ago

devellopah commented 3 years ago

An issue

On npm run watch command, i've got pug files compiled and placed at

/dist/home/devellopah/projects/tailwind/tailwind-starter/src/views/index.html

when i expect them to appear at

/dist/index.html

Other assets are placed correctly(manifest)

I am on linux mint tessa

How to reproduce

  1. you probably should be on linux
  2. git clone repo
  3. run npm install
  4. run npm run watch

Please help, i really want to use pug with tailwindcss.

mikemartin commented 3 years ago

Hey @devellopah!

Could you please share your webpack and tailwindcss configs?

devellopah commented 3 years ago

Hi @mikemartin tailwindcss webpack

mikemartin commented 3 years ago

Hey @devellopah Adding the excludePath option should solve this for you.

.pug('src/views/**/*.pug', 'dist', {
    excludePath: 'src/views',
    pug: {
      pretty: true,
      debug: true
    }
  })
devellopah commented 3 years ago

@mikemartin Yep, it fixed the issue, many thanks!

LouisBerBiq commented 2 years ago

This does not seem to fix the issue on Windows, it even straight up errors out because of the drive letter.

mikemartin commented 2 years ago

What’s the error?

On November 19, 2021, GitHub @.***> wrote:

This does not seem to fix the issue on Windows, it even straight up errors out because of the drive letter.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mikemartin/laravel-mix-pug- recursive/issues/2#issuecomment-972997483, or unsubscribe https://github.com/notifications/unsubscribe- auth/AADFEA3AH6NR6MEZZM5O7Z3UMUOXZANCNFSM4YJGJZ4A.

LouisBerBiq commented 2 years ago
Error: EINVAL: invalid argument, mkdir 'C:\Users\dist\C:\Users\username\site\src\pug'
    at Object.mkdirSync (node:fs:1334:3)
    at Function.sync (C:\Users\username\site\node_modules\mkdirp\index.js:72:13)
    at MixPugTask.prepareAssets (C:\Users\username\site\node_modules\laravel-mix-pug-recursive\src\MixPugTask.js:171:20)  
    at C:\Users\username\site\node_modules\laravel-mix-pug-recursive\src\MixPugTask.js:59:47
    at Array.map (<anonymous>)
    at MixPugTask.run (C:\Users\username\site\node_modules\laravel-mix-pug-recursive\src\MixPugTask.js:59:29)
    at CustomTasksPlugin.runTask (C:\Users\username\site\node_modules\laravel-mix\src\webpackPlugins\CustomTasksPlugin.js:45:36)
    at CustomTasksPlugin.runTasks (C:\Users\username\site\node_modules\laravel-mix\src\webpackPlugins\CustomTasksPlugin.js:86:21)
    at C:\Users\username\site\node_modules\laravel-mix\src\webpackPlugins\CustomTasksPlugin.js:20:24
    at Hook.eval [as callAsync] (eval at create (C:\Users\username\site\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:61:17) {
  errno: -4071,
  syscall: 'mkdir',
  code: 'EINVAL',
  path: 'C:\\Users\\dist\\C:\\Users\\username\\site\\src\\pug'
}

the project is located in C:\Users\username\site

Sorry for the delay, I honestly forgot about this issue since using the original project instead seemed to work for me and if it was a windows pathing issue, I would have probably used WSL2 at some point.

mikemartin commented 2 years ago

Thanks for getting back to me @LouisBerBiq. Useful to know that it worked on the original repo. 🤔