Hi,
Urls using @asset
(e.g., @asset('images/imageFile.svg')
) started returning 404 errors after upgrading Bud from 5.7.2 to 6.3.5. Images work fine in development but not in the production build after deploying with Trellis.
package.json before update:
{
"name": "sage",
"private": true,
"browserslist": [
"extends @wordpress/browserslist-config"
],
"engines": {
"node": ">=16.0.0"
},
"scripts": {
"dev": "bud dev",
"build": "bud build",
"translate": "npm run translate:pot && npm run translate:js",
"translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --ignore-domain --include=\"app,resources\"",
"translate:js": "wp i18n make-json ./resources/lang --pretty-print"
},
"devDependencies": {
"@roots/bud": "5.7.2",
"@roots/bud-tailwindcss": "5.7.2",
"@roots/sage": "5.7.2"
}
}
Current:
{
"name": "sage",
"private": true,
"engines": {
"node": ">=16.0.0"
},
"scripts": {
"dev": "bud dev",
"build": "bud build",
"translate": "npm run translate:pot && npm run translate:js",
"translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --ignore-domain --include=\"app,resources\"",
"translate:js": "wp i18n make-json ./resources/lang --pretty-print",
"lint": "npm run lint:js && npm run lint:css",
"lint:js": "eslint resources/scripts",
"lint:css": "stylelint \"resources/**/*.{css,scss,vue}\"",
"test": "npm run lint"
},
"devDependencies": {
"@roots/browserslist-config": "6.3.5",
"@roots/bud": "6.3.5",
"@roots/bud-eslint": "^6.3.5",
"@roots/bud-tailwindcss": "6.3.5",
"@roots/bud-vue": "6.3.5",
"@roots/sage": "6.3.5"
},
"dependencies": {}
bud.config.mjs:
/**
* @typedef {import('@roots/bud').Bud} bud
*
* @param {bud} app
*/
export default async (app) => {
app
/**
* Application entrypoints
*
* Paths are relative to your resources directory
*/
.entry({
app: ['@scripts/app', '@styles/app'],
editor: ['@scripts/editor', '@styles/editor'],
})
/**
* These files should be processed as part of the build
* even if they are not explicitly imported in application assets.
*/
.assets('images')
/**
* These files will trigger a full page reload
* when modified.
*/
.watch('resources/views/**/*', 'app/**/*')
/**
* Target URL to be proxied by the dev server.
*
* This should be the URL you use to visit your local development server.
*/
.proxy('http://example.test')
/**
* Development URL to be used in the browser.
*/
.serve('http://0.0.0.0:64912');
}
Any idea what could. be causing this?