chore: baseline import
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { copyFile, readdir } from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
|
||||
const chunksDir = path.resolve(process.cwd(), '.next/static/chunks')
|
||||
const entries = await readdir(chunksDir)
|
||||
const hashedMainApp = entries.find((entry) => /^main-app-[^.]+\.(js)$/.test(entry))
|
||||
|
||||
if (!hashedMainApp) {
|
||||
console.warn('[fix-next-main-app] No hashed main-app chunk found, skipping.')
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
const source = path.join(chunksDir, hashedMainApp)
|
||||
const target = path.join(chunksDir, 'main-app.js')
|
||||
|
||||
await copyFile(source, target)
|
||||
console.log(`[fix-next-main-app] Copied ${hashedMainApp} -> main-app.js`)
|
||||
Reference in New Issue
Block a user