diff --git a/next.config.ts b/next.config.ts index 4b17ba1..c9cb9bd 100644 --- a/next.config.ts +++ b/next.config.ts @@ -3,9 +3,14 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: "export", distDir: "dist", + compress: true, images: { unoptimized: true, }, + experimental: { + inlineCss: true, + optimizePackageImports: ["lucide-react", "gsap"], + }, }; export default nextConfig; diff --git a/package.json b/package.json index bc23693..aa4245f 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "next dev", "build": "next build", + "postbuild": "node scripts/cleanup-legacy.js", "start": "next start", "lint": "next lint" }, @@ -19,6 +20,12 @@ "tailwind-merge": "^3.5.0", "tailwindcss": "^4.2.4" }, + "browserslist": [ + "last 2 Chrome versions", + "last 2 Firefox versions", + "last 2 Safari versions", + "last 2 Edge versions" + ], "devDependencies": { "@tailwindcss/postcss": "^4.2.4", "@types/node": "^24.12.2", diff --git a/scripts/cleanup-legacy.js b/scripts/cleanup-legacy.js new file mode 100644 index 0000000..e766cd4 --- /dev/null +++ b/scripts/cleanup-legacy.js @@ -0,0 +1,57 @@ +import { readFileSync, writeFileSync, unlinkSync, readdirSync, statSync } from "fs"; +import { join } from "path"; + +const distDir = "./dist"; + +function walk(dir, callback) { + for (const entry of readdirSync(dir)) { + const fullPath = join(dir, entry); + const stats = statSync(fullPath); + if (stats.isDirectory()) { + walk(fullPath, callback); + } else { + callback(fullPath, stats); + } + } +} + +// Remove noModule script tags from all HTML files +let htmlCount = 0; +walk(distDir, (filePath) => { + if (filePath.endsWith(".html")) { + let content = readFileSync(filePath, "utf-8"); + const before = content.length; + // Remove both