I
I
Islam Ibakaev2021-02-25 23:04:43
Pug
Islam Ibakaev, 2021-02-25 23:04:43

How to make pug and laravel-mix friends?

Hello. I'm making a starter for tailwindcss . Decided to use the laravel-mix package to add webpack config capability in the starter. At some point, I wanted to add the ability to work with pug - I pulled up the laravel-mix extension . The problem is that as a result of compilation I get the following result
6038015e3154e523449078.png
. Please tell me the changes for the current webpack.mix.js in order to spit html files directly into the dist folder .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Tratorov, 2021-10-13
@NikitaTratorov

Everything in your version is correct.

mix.pug('src/views/**/*.pug', 'dist', {
    excludePath: 'src/views',
    pug: {
      pretty: true,
      debug: true
    }
  })

Try to make sure that the plugin does not interfere with the absence of a folder.
And try another plugin, for example, it connects in the same way. This is how the option looks like when html files are placed in the same folder as the pug source."laravel-mix-pug": "^0.3.0"
mix.pug("public/*.pug", "./", {
        pug: {
            pretty: true
        }
    })

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question