forked from infiniflow/infinity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Set output to standalone and add deploy command to facilitate d…
…eployment of the project infiniflow#1841
- Loading branch information
Showing
4 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"extends": ["next/core-web-vitals", "next/typescript", "prettier"] | ||
"extends": ["next/core-web-vitals", "next/typescript", "prettier"], | ||
"ignorePatterns": ["copy.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const nextStaticPath = path.join(__dirname, '.next', 'static'); | ||
const nextStandalonePath = path.join( | ||
__dirname, | ||
'.next', | ||
'standalone', | ||
'public', | ||
'_next' | ||
); | ||
|
||
function copyFolderRecursiveSync(src, dest) { | ||
const exists = fs.existsSync(src); | ||
const stats = exists && fs.statSync(src); | ||
const isDirectory = exists && stats.isDirectory(); | ||
if (isDirectory) { | ||
fs.mkdirSync(dest, { recursive: true }); | ||
fs.readdirSync(src).forEach((childItemName) => { | ||
copyFolderRecursiveSync( | ||
path.join(src, childItemName), | ||
path.join(dest, childItemName) | ||
); | ||
}); | ||
} else { | ||
fs.copyFileSync(src, dest); | ||
} | ||
} | ||
|
||
copyFolderRecursiveSync(nextStaticPath, nextStandalonePath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,9 @@ | |
"dev": "next dev -p 3033", | ||
"build": "next build", | ||
"start": "next start -p 3043", | ||
"lint": "next lint" | ||
"lint": "next lint", | ||
"copy": "node copy.js", | ||
"deploy": "next build && pnpm run copy" | ||
}, | ||
"dependencies": { | ||
"@hookform/resolvers": "^3.9.0", | ||
|
@@ -66,4 +68,4 @@ | |
"@types/react-dom": "npm:[email protected]" | ||
} | ||
} | ||
} | ||
} |