New Sage 10 install with bud version 6.8.0.
Bud Dev is working but the page in the browser is not self reloading after save. I have to do it manually to see any changes.
The .watch relates to ‘resources/views’ and ‘app’ like so:
.watch([‘resources/views’, ‘app’])
Do I need to specify something else?
talss89
February 22, 2023, 11:42am
2
Hi @ZiggyStick ,
Sage 10 should work ‘out-of-the-box’ with HMR, with minimal configuration.
How are you accessing your project in the browser? You should be using the HMR server typically on port 3000. Try http://localhost:3000
Another thing to check is the proxy origin and public path configuration in bud.config.js
.
For context, in your bud.config.js
:
/**
* Proxy origin (`WP_HOME`)
* @see {@link https://bud.js.org/docs/bud.proxy/}
*/
.proxy('https://your-wp-home-here')
/**
* Development origin
* @see {@link https://bud.js.org/docs/bud.serve/}
*/
.serve('http://localhost:3000')
/**
* URI of the `public` directory
* @see {@link https://bud.js.org/docs/bud.setPublicPath/}
*/
.setPublicPath('/app/themes/your-sage-theme-folder-name/public/')
Hopefully that helps, if not, please share an example of your bud.config.js
file, and we can look into this further.
1 Like
Hi there,
thanks for your answer and sorry for my late reply.
If I use ‘localhost:3000’ I get the following: Error occurred while trying to proxy: localhost:3000/
So I set the .serve to the domain name, which works with manually refreshing of the browser.
My bud.config.js:
/**
Build configuration
@see {@link Sage | WordPress Starter Theme with Tailwind CSS & Blade | Roots sage documentation}
@see {@link https://bud.js.org/guides/configure/ bud.js configuration guide}
@typedef {import(‘@roots /bud’).Bud} Bud
@param {Bud} app
/
export default async (app) => {
/ *
Application entrypoints
@see {@link https://bud.js.org/docs/bud.entry/ }
*/
app
.entry({
app: [‘@scripts /app’, ‘@styles /app’],
editor: [‘@scripts /editor’, ‘@styles /editor’],
})
/**
/**
/**
/**
/**
/**
Generate WordPress theme.json
@note This overwrites theme.json
on every build.
@see {@link https://bud.js.org/extensions/sage/theme.json/ }
@see {@link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/ }
*/
.wpjson.settings({
color: {
custom: false,
customDuotone: false,
customGradient: false,
defaultDuotone: false,
defaultGradients: false,
defaultPalette: false,
duotone: ,
},
custom: {
spacing: {},
typography: {
‘font-size’: {},
‘line-height’: {},
},
},
spacing: {
padding: true,
units: [‘px’, ‘%’, ‘em’, ‘rem’, ‘vw’, ‘vh’],
},
typography: {
customFontSize: false,
},
})
.useTailwindColors()
.useTailwindFontFamily()
.useTailwindFontSize()
.enable();
};