Skip to content

Commit

Permalink
bump Node.js version of netlify (#2240)
Browse files Browse the repository at this point in the history
* bump Node.js version of netlify.toml

* Skip Husky install in production and CI

* use node-lts

---------

Signed-off-by: Uiolee <[email protected]>
  • Loading branch information
uiolee committed Aug 29, 2024
1 parent 506af86 commit 994c8c1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .husky/install.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Skip Husky install in production and CI
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
console.warn('Skip Husky install in production and CI.')
process.exit(0)
}
const husky = (await import('husky')).default
console.log(husky())
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build]
command = "npm run build"
publish = "/public"
environment = { NODE_VERSION = "14", NODE_ENV = "production" }
environment = { NODE_VERSION = "lts/*", NODE_ENV = "production" }

[[redirects]]
from = "/"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "hexo generate",
"eslint": "eslint .",
"format:md": "prettier --write */**/docs/*.md */**/api/*.md",
"prepare": "husky"
"prepare": "node .husky/install.mjs"
},
"dependencies": {
"cheerio": "^0.22.0",
Expand Down Expand Up @@ -46,4 +46,4 @@
"engines": {
"node": ">=14"
}
}
}

0 comments on commit 994c8c1

Please sign in to comment.