Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ben Word <ben@benword.com>
89 lines
2.1 KiB
JavaScript
89 lines
2.1 KiB
JavaScript
/**
|
|
* 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('http://example.test')
|
|
|
|
/**
|
|
* 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/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();
|
|
};
|