Skip to content

Commit

Permalink
fix: ensure hugo is available in preview builds
Browse files Browse the repository at this point in the history
- Add hugo-bin dependency with specific version 0.136.3
- Update build-preview.js to use npx hugo
- Remove unnecessary dependencies
- Set proper environment variables for hugo build
  • Loading branch information
RileySeaburg committed Dec 3, 2024
1 parent d78cf3d commit 10d74a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@
"eslint": "^8.56.0",
"fs-extra": "^11.2.0",
"glob": "^10.3.10",
"hugo-bin": "0.136.3",
"list.js": "^2.3.1",
"mime-types": "^2.1.35",
"npm-run-all": "^4.1.5",
"sass": "^1.69.7",
"sass-embedded": "^1.69.7",
"sharp": "^0.33.5",
"svg-sprite": "^2.0.2"
},
"devDependencies": {
Expand Down
10 changes: 8 additions & 2 deletions scripts/build-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ async function buildPreview() {

// Build the site using the preview config
console.log('Building site with preview configuration...');
execSync('hugo --config config.yml,config/env/preview/config.yml', {
stdio: 'inherit'

// Use npx to ensure hugo is available
execSync('npx hugo --config config.yml,config/env/preview/config.yml', {
stdio: 'inherit',
env: {
...process.env,
NODE_ENV: 'production'
}
});

console.log('Preview build completed successfully');
Expand Down

0 comments on commit 10d74a6

Please sign in to comment.