replace contents with tweakcn-next

This commit is contained in:
Sahaj Jain
2025-04-17 14:18:28 +05:30
parent 8521b6a356
commit b3f5de8a3d
340 changed files with 33366 additions and 3383 deletions
+43
View File
@@ -0,0 +1,43 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config: any) => {
const fileLoaderRule = config.module.rules.find((rule: any) =>
rule.test?.test?.(".svg")
);
config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: [
{
loader: "@svgr/webpack",
options: {
dimensions: false,
titleProp: true,
},
},
],
}
);
// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i;
config.resolve.alias = {
...config.resolve.alias,
"@": ".",
};
return config;
},
};
export default nextConfig;