Working on my first Sage 10x project with Bud. I’ve tried reading the docs on the bud.proxy and bud.serve, and changing around the bud config file.
I also added some regex to the .watch path names.
I also upgraded to 6.0.0, and it’s still not working.
Here’s my config file:
/**
* Build configuration
*
* @see {@link https://roots.io/docs/sage/ 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'],
})
/**
* Directory contents to be included in the compilation
* @see {@link https://bud.js.org/docs/bud.assets/}
*/
.assets(['images'])
/**
* Matched files trigger a page reload when modified
* @see {@link https://bud.js.org/docs/bud.watch/}
*/
.watch(['resources/views/**/*', 'app/**/*'])
/**
* Proxy origin (`WP_HOME`)
* @see {@link https://bud.js.org/docs/bud.proxy/}
*/
.proxy(new URL('http://fhcnyc.test'))
/**
* Development origin
* @see {@link https://bud.js.org/docs/bud.serve/}
*/
.serve('http://0.0.0.0:3000')
/**
* URI of the `public` directory
* @see {@link https://bud.js.org/docs/bud.setPublicPath/}
*/
.setPublicPath('/app/themes/sage/public/')
/**
* 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();
};
I am coming from an older Trellis/Bedrock/Sage9x stack, so this is probably ignorance on my part. With the old stack, I’d have my virtual env running under dev domain. To enable hot reload, I’d launch a dev server under a localhost.
However, after starting the dev environment with Bud, localhost forwards to the virtual domain.
Two questions:
Is there an issue with my config that is preventing the hot reload?
Re. the forwarding from dev server url to virtual env url, is this expected behavior with bud?