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 = {
|
const nextConfig: NextConfig = {
|
||||||
turbopack: { root: import.meta.dirname },
|
turbopack: {},
|
||||||
serverExternalPackages: [
|
serverExternalPackages: [
|
||||||
"@prisma/adapter-mariadb",
|
"@prisma/adapter-mariadb",
|
||||||
"mariadb",
|
"mariadb",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ async function writeSqlMigration(params: {
|
|||||||
const padded = String(num).padStart(4, "0");
|
const padded = String(num).padStart(4, "0");
|
||||||
const className = params.classname.replace(/[^a-zA-Z0-9_-]/g, "_");
|
const className = params.classname.replace(/[^a-zA-Z0-9_-]/g, "_");
|
||||||
const fileName = `${padded}_import_furni_${className}.sql`;
|
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[] = [
|
const lines: string[] = [
|
||||||
`-- Migration: ${fileName}`,
|
`-- Migration: ${fileName}`,
|
||||||
@@ -192,7 +192,7 @@ export async function uploadSingleFurni(params: {
|
|||||||
const { iconDir, nitroDir } = await getFurniAssetDirs();
|
const { iconDir, nitroDir } = await getFurniAssetDirs();
|
||||||
|
|
||||||
const nitroFileName = `${classname}.nitro`;
|
const nitroFileName = `${classname}.nitro`;
|
||||||
const nitroPath = path.join(nitroDir, nitroFileName);
|
const nitroPath = path.join(/*turbopackIgnore: true*/ nitroDir, nitroFileName);
|
||||||
if (existsSync(nitroPath)) {
|
if (existsSync(nitroPath)) {
|
||||||
return {
|
return {
|
||||||
ok: false,
|
ok: false,
|
||||||
@@ -207,7 +207,7 @@ export async function uploadSingleFurni(params: {
|
|||||||
let iconPath: string | null = null;
|
let iconPath: string | null = null;
|
||||||
if (iconBuffer && iconBuffer.length > 0) {
|
if (iconBuffer && iconBuffer.length > 0) {
|
||||||
iconFileName = `${classname}_icon.png`;
|
iconFileName = `${classname}_icon.png`;
|
||||||
iconPath = path.join(iconDir, iconFileName);
|
iconPath = path.join(/*turbopackIgnore: true*/ iconDir, iconFileName);
|
||||||
await fs.writeFile(iconPath, iconBuffer);
|
await fs.writeFile(iconPath, iconBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user