diff --git a/bud.config.js b/bud.config.js new file mode 100644 index 0000000..22deb1e --- /dev/null +++ b/bud.config.js @@ -0,0 +1,88 @@ +/** + * 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://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(); +}; diff --git a/bud.config.mjs b/bud.config.mjs deleted file mode 100644 index a1267e1..0000000 --- a/bud.config.mjs +++ /dev/null @@ -1,79 +0,0 @@ -// @ts-check - -/** - * Build configuration - * - * @see {@link https://bud.js.org/guides/configure} - * @param {import('@roots/bud').Bud} app - */ -export default async (app) => { - app - /** - * Application entrypoints - */ - .entry({ - app: ["@scripts/app", "@styles/app"], - editor: ["@scripts/editor", "@styles/editor"], - }) - - /** - * Directory contents to be included in the compilation - */ - .assets(["images"]) - - /** - * Matched files trigger a page reload when modified - */ - .watch(["resources/views/**/*", "app/**/*"]) - - /** - * Proxy origin (`WP_HOME`) - */ - .proxy("http://example.test") - - /** - * Development origin - */ - .serve("http://0.0.0.0:3000") - - /** - * URI of the `public` directory - */ - .setPublicPath("/app/themes/sage/public/") - - /** - * Generate WordPress `theme.json` - * - * @note This overwrites `theme.json` on every build. - */ - .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() -};