fix: tailwindcss v4 build

This commit is contained in:
Yumin Gui
2025-07-18 00:23:55 -07:00
parent 3d81da84ae
commit c6fc6c8a48
15 changed files with 239 additions and 241 deletions

View File

@@ -1,9 +1,10 @@
/** @type {import('next').NextConfig} */
/* eslint-disable @typescript-eslint/no-var-requires */
import withPWA from "next-pwa";
const nextConfig = {
output: 'standalone',
output: "standalone",
eslint: {
dirs: ['src'],
dirs: ["src"],
},
reactStrictMode: false,
@@ -14,12 +15,12 @@ const nextConfig = {
unoptimized: true,
remotePatterns: [
{
protocol: 'https',
hostname: '**',
protocol: "https",
hostname: "**",
},
{
protocol: 'http',
hostname: '**',
protocol: "http",
hostname: "**",
},
],
},
@@ -27,7 +28,7 @@ const nextConfig = {
webpack(config) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) =>
rule.test?.test?.('.svg')
rule.test?.test?.(".svg")
);
config.module.rules.push(
@@ -42,7 +43,7 @@ const nextConfig = {
test: /\.svg$/i,
issuer: { not: /\.(css|scss|sass)$/ },
resourceQuery: { not: /url/ }, // exclude if *.svg?url
loader: '@svgr/webpack',
loader: "@svgr/webpack",
options: {
dimensions: false,
titleProp: true,
@@ -64,11 +65,11 @@ const nextConfig = {
},
};
const withPWA = require('next-pwa')({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
const pwaConfig = withPWA({
dest: "public",
disable: process.env.NODE_ENV === "development",
register: true,
skipWaiting: true,
});
module.exports = withPWA(nextConfig);
export default pwaConfig(nextConfig);