Skip to content

Commit

Permalink
fix: improve performances
Browse files Browse the repository at this point in the history
  • Loading branch information
thedaviddias committed Aug 3, 2023
1 parent 62d9612 commit 8eb43b9
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 105 deletions.
26 changes: 12 additions & 14 deletions apps/blog/next.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/** @type {import('next').NextConfig} */
const nextTranslate = require('next-translate-plugin')
const { withSentryConfig } = require('@sentry/nextjs')
const { withPlausibleProxy } = require('next-plausible')
const withPlugins = require('next-compose-plugins')
const withBundleAnalyzer = require('@next/bundle-analyzer')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

const path = require('path')

const plausiblePlugin = withPlausibleProxy
const bundleAnalyser = withBundleAnalyzer({ enabled: process.env.ANALYZE === 'true' })

const plugins = [plausiblePlugin, bundleAnalyser]
const plugins = [plausiblePlugin]

const nextConfig = withPlugins([plugins, nextTranslate], {
reactStrictMode: true,
Expand Down Expand Up @@ -49,6 +51,10 @@ const nextConfig = withPlugins([plugins, nextTranslate], {
},
]
},
// Ref: https://nextjs.org/docs/advanced-features/output-file-tracing#caveats
experimental: {
outputFileTracingRoot: path.join(__dirname, '../../'),
},
webpack(config) {
config.module.rules.push({
test: /\.(png|jpe?g|gif|mp4)$/i,
Expand Down Expand Up @@ -94,16 +100,8 @@ const nextConfig = withPlugins([plugins, nextTranslate], {
},
})

const sentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
silent: true, // Suppresses all logs
dryRun: process.env.VERCEL_ENV !== 'production',
}
const moduleExports = nextConfig

// Make sure adding Sentry options is the last code to run before exporting, to
// ensure that your source maps include changes from all other Webpack plugins
module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions)
module.exports = moduleExports
1 change: 1 addition & 0 deletions apps/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"scripts": {
"build": "next build",
"analyse": "ANALYZE=true next build",
"postbuild": "next-sitemap",
"check:all": "pnpm check:format && pnpm check:lint && pnpm build",
"check:format": "prettier --check .",
Expand Down
2 changes: 1 addition & 1 deletion apps/blog/public/rss/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>The David Dias | Front-End Developer, Podcaster &amp; Content Creator</title>
<link>https://thedaviddias.dev</link>
<description>Hey, I'm David Dias, a Front-End Developer based in Toronto/Canada. I love discussing code, technology, expatriation and life.</description>
<lastBuildDate>Thu, 03 Aug 2023 02:23:21 GMT</lastBuildDate>
<lastBuildDate>Thu, 03 Aug 2023 03:54:49 GMT</lastBuildDate>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<generator>https://github.com/jpmonette/feed</generator>
<language>en-US</language>
Expand Down
2 changes: 1 addition & 1 deletion apps/blog/public/rss/fr/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>The David Dias | Développeur Front-End, podcasteur &amp; créateur de contenu</title>
<link>https://thedaviddias.dev</link>
<description>Salut toi! Je m'appele David Dias. Je suis développeur Front-End, podcasteur, créateur de contenu numérique passioné pour résoudre les problèmes digitaux et humains! J'aime rencontrer de nouvelles personnes, bâtir des communautées et parler de tech, d'expatriation et de web.</description>
<lastBuildDate>Thu, 03 Aug 2023 02:23:21 GMT</lastBuildDate>
<lastBuildDate>Thu, 03 Aug 2023 03:54:49 GMT</lastBuildDate>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<generator>https://github.com/jpmonette/feed</generator>
<language>fr</language>
Expand Down
174 changes: 87 additions & 87 deletions apps/blog/public/sitemap-0.xml

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion apps/blog/src/components/MdxComponents/tweet.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { TwitterEmbed, TwitterEmbedProps } from 'react-social-media-embed'
import {
TwitterEmbed,
TwitterEmbedProps,
} from 'react-social-media-embed/dist/components/embeds/TwitterEmbed'

export const Tweet = (props: TwitterEmbedProps) => {
return (
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"build": "turbo build",
"dev": "turbo dev",
"lint": "turbo lint",
"analyse": "turbo analyse",
"test": "turbo test",
"clean": "turbo clean",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
Expand Down
3 changes: 2 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"$schema": "https://turbo.build/schema.json",
"globalEnv": ["VERCEL_URL", "VERCEL_ENV", "NODE_ENV", "GH_PUBLIC_TOKEN", "GOOGLE_CLIENT_EMAIL", "GOOGLE_PRIVATE_KEY", "SPOTIFY_CLIENT_ID", "SPOTIFY_CLIENT_SECRET", "SPOTIFY_REFRESH_TOKEN", "PLAUSIBLE_API_KEY", "SIMKL_TOKEN", "SIMKL_CLIENT_ID", "SIMKL_USER_ID", "STEAM_USER_ID", "STEAM_KEY", "UNSPLASH_ACCESS_KEY", "WAKATIME_API_KEY", "YOUTUBE_CHANNEL_ID", "RAINDROP_COLLECTION", "RAINDROP_TOKEN"],
"globalEnv": ["VERCEL_URL", "VERCEL_ENV", "NODE_ENV", "GH_PUBLIC_TOKEN", "GOOGLE_CLIENT_EMAIL", "GOOGLE_PRIVATE_KEY", "SPOTIFY_CLIENT_ID", "SPOTIFY_CLIENT_SECRET", "SPOTIFY_REFRESH_TOKEN", "PLAUSIBLE_API_KEY", "SIMKL_TOKEN", "SIMKL_CLIENT_ID", "SIMKL_USER_ID", "STEAM_USER_ID", "STEAM_KEY", "UNSPLASH_ACCESS_KEY", "WAKATIME_API_KEY", "YOUTUBE_CHANNEL_ID", "RAINDROP_COLLECTION", "RAINDROP_TOKEN", "ANALYSE"],
"globalDependencies": ["**/.env.*local"],
"pipeline": {
"build": {
"outputs": [".next/**", "!.next/cache/**"]
},
"lint": {},
"test": {},
"analyse": {},
"check-types": {},
"dev": {
"cache": false,
Expand Down

2 comments on commit 8eb43b9

@vercel
Copy link

@vercel vercel bot commented on 8eb43b9 Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8eb43b9 Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.