Fix Turbopack NFT warning
- Remove import.meta.dirname from turbopack config (unnecessary filesystem op) - Add /*turbopackIgnore: true*/ to 3 path.join calls in upload-import.ts that were missing the comment, causing Turbopack to trace the whole project unintentionally
This commit is contained in:
1 parent
f6ee99801d
commit
a9f1f4f99d
2 files changed
+4
-4
No files matched your search
+1
-1
@@ -20,7 +20,7 @@ const securityHeaders = [
|
||||
];
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
turbopack: { root: import.meta.dirname },
|
||||
turbopack: {},
|
||||
serverExternalPackages: [
|
||||
"@prisma/adapter-mariadb",
|
||||
"mariadb",
|
||||
|
||||
@@ -99,7 +99,7 @@ async function writeSqlMigration(params: {
|
||||
const padded = String(num).padStart(4, "0");
|
||||
const className = params.classname.replace(/[^a-zA-Z0-9_-]/g, "_");
|
||||
const fileName = `${padded}_import_furni_${className}.sql`;
|
||||
const filePath = path.join(MIGRATIONS_DIR, fileName);
|
||||
const filePath = path.join(/*turbopackIgnore: true*/ MIGRATIONS_DIR, fileName);
|
||||
|
||||
const lines: string[] = [
|
||||
`-- Migration: ${fileName}`,
|
||||
@@ -192,7 +192,7 @@ export async function uploadSingleFurni(params: {
|
||||
const { iconDir, nitroDir } = await getFurniAssetDirs();
|
||||
|
||||
const nitroFileName = `${classname}.nitro`;
|
||||
const nitroPath = path.join(nitroDir, nitroFileName);
|
||||
const nitroPath = path.join(/*turbopackIgnore: true*/ nitroDir, nitroFileName);
|
||||
if (existsSync(nitroPath)) {
|
||||
return {
|
||||
ok: false,
|
||||
@@ -207,7 +207,7 @@ export async function uploadSingleFurni(params: {
|
||||
let iconPath: string | null = null;
|
||||
if (iconBuffer && iconBuffer.length > 0) {
|
||||
iconFileName = `${classname}_icon.png`;
|
||||
iconPath = path.join(iconDir, iconFileName);
|
||||
iconPath = path.join(/*turbopackIgnore: true*/ iconDir, iconFileName);
|
||||
await fs.writeFile(iconPath, iconBuffer);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user