philicevic / mix-html-builder

A quick laravel mix extension to build up html templates from partials and layouts.
MIT License
19 stars 8 forks source link

Changes to "includes" files are not rebuilt #21

Open weblabio opened 4 years ago

weblabio commented 4 years ago

browser-sync: ^2.26.7 browser-sync-webpack-plugin: ^2.0.1 laravel-mix: ^5.0.1 mix-html-builder: ^0.6.1

home.html

<include src="start.html" locals='{
    "pageTitle": "HomePage",
    "pageClass": "page-home"
}'></include>

<extends src="default.html">
    <block name="content">
        <h1>Welcome!!</h1>
    </block>
</extends>

<include src="end.html"></include>

layouts/default.html

<include src="header.html"></include>

<block name="content"></block>

<include src="footer.html"></include>

If I make an edit in start.html then the changes are reassembled but if i make an edit in header.html or footer.html (used into layout) are not rebuilt BrowserSync write in console: Reloading Browsers...

maybe I incorrectly configured the assembly?

mix.setPublicPath('build')

mix.browserSync({
    server: {
        baseDir: 'build',
        directory: false,
        index: 'home.html'
    },
    proxy: false,
    logPrefix: 'PlushHouse',
    open: false,
    notify: false,
    files: ['src/**/*']
})

mix.html({
    htmlRoot: 'src/html/*.html',
    output: '.',
    partialRoot: 'src/html/partials',
    layoutRoot: 'src/html/layouts',
    minify: {
        removeComments: true,
    },
    postHtmlConfig: {
        extend: {
            strict: false
        }
    }
})
philicevic commented 4 years ago

So, am I getting it right, that BrowserSync indeed does write into you console that it is reloading the Browser?

BTW: Thanks a lot for the detailed issues you're creating @WebLab-ImpCode!

weblabio commented 4 years ago

Yes, BrowserSync reports an update and the page really reloads I double-checked again and recorded the video: mixhtml-2020-07-17_00 24 03

header.html (left) - this file is included inside <extends> home.html (right) - root file

if I change header.html, then the page refreshes, but rebuilding does not work. if I change home.html, then everything is fine and the changes in header.html will also be rebuilt

adayth commented 4 years ago

I'm facing the same issue and tried to fix using in browsersync config: modifying files settings or using watch: true without success. Other files work properly.

Did anyone find a way to work around this issue?