Skip to content

Commit

Permalink
chore: add logo-react.svg to home page and update Next.js config for …
Browse files Browse the repository at this point in the history
…SVG handling
  • Loading branch information
everton-dgn committed Feb 3, 2025
1 parent c288a93 commit 7dde501
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
33 changes: 24 additions & 9 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
import type { NextConfig } from 'next'

const IS_DEVELOPMENT = process.env.NODE_ENV !== 'production'

const nextConfig: NextConfig = {
// experimental: {
// ppr: 'incremental',
// turbo: {
// rules: {
// '*.svg': {
// loaders: ['@svgr/webpack'],
// as: '*.js',
// },
// },
// },
// ppr: 'incremental'
// },
experimental: IS_DEVELOPMENT
? {
turbo: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
},
}
: {},
webpack(config) {
if (!IS_DEVELOPMENT) {
config.module.rules.push({
test: /\.svg$/i,
use: ['@svgr/webpack'],
})
}
return config
},
images: {
deviceSizes: [450, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
remotePatterns: [{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"description": "This application is a boilerplate for complex and large systems, especially those that need to scale with security and code quality.",
"repository": "https://github.com/everton-dgn/boilerplate_nextjs_app",
"scripts": {
"dev": "next dev --turbopack",
"dev": "next dev --turbo",
"start": "next start",
"build": "next build --no-lint",
"lint": "biome check ./src",
Expand Down
3 changes: 3 additions & 0 deletions src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { CounterButton } from 'components/atoms/CounterButton'

import S from './styles.module.css'

import LogoReact from 'assets/logo-react.svg'

const Home = () => (
<div className={S.container}>
<header className={S.header}>Boilerplate</header>
Expand All @@ -16,6 +18,7 @@ const Home = () => (
src="/images/logo-nextjs.webp"
width={77}
/>
<LogoReact data-testid="logo-react" />
</div>
<h1 className={S.title}>Nextjs + React</h1>
<CounterButton />
Expand Down

0 comments on commit 7dde501

Please sign in to comment.