Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: バンドルサイズの最適化 #377

Merged
merged 6 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
5 changes: 4 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
const nextConfig = {
output: "export",
};
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});

module.exports = nextConfig;
module.exports = withBundleAnalyzer(nextConfig);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@fortawesome/free-brands-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@next/bundle-analyzer": "^14.0.4",
"date-fns": "^2.30.0",
"emojify-tag": "^1.0.0",
"framer-motion": "^10.16.12",
Expand Down
5 changes: 3 additions & 2 deletions src/app/components/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import {
useColorModeValue,
useDisclosure,
} from "@chakra-ui/react";
import { faMoon, faSun } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import NextLink from "next/link";
import { faBars } from "@fortawesome/free-solid-svg-icons";
import { faBars } from "@fortawesome/free-solid-svg-icons/faBars";
import { faMoon } from "@fortawesome/free-solid-svg-icons/faMoon";
import { faSun } from "@fortawesome/free-solid-svg-icons/faSun";
import { useRef } from "react";

export interface LinksProps {
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/prev-next-link.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Button, Flex, Spacer } from "@chakra-ui/react";
import { faArrowLeft, faArrowRight } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import NextLink from "next/link";
import { faArrowLeft } from "@fortawesome/free-solid-svg-icons/faArrowLeft";
import { faArrowRight } from "@fortawesome/free-solid-svg-icons/faArrowRight";

export type PrevNextLinkProps = {
prevLinkHref: string | null;
Expand Down
4 changes: 3 additions & 1 deletion src/app/components/sns-link.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { IconDefinition, faGithub, faTwitter } from "@fortawesome/free-brands-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import type { IconDefinition } from "@fortawesome/free-brands-svg-icons";
import { Link } from "@chakra-ui/react";
import type { SNSLinkInfo } from "../lib/member-fetch";
import { faGithub } from "@fortawesome/free-brands-svg-icons/faGithub";
import { faTwitter } from "@fortawesome/free-brands-svg-icons/faTwitter";

type Icon = { icon: IconDefinition };

Expand Down
5 changes: 4 additions & 1 deletion src/app/providers.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"use client";

import { LazyMotion, domAnimation } from "framer-motion";
import { ChakraProvider } from "@chakra-ui/react";
import { theme } from "./lib/theme";
import { yearContext } from "./lib/year-context";

export function Providers({ children }: { children: React.ReactNode }) {
return (
<yearContext.Provider value={new Date().getFullYear()}>
<ChakraProvider theme={theme}>{children}</ChakraProvider>
<LazyMotion features={domAnimation}>
<ChakraProvider theme={theme}>{children}</ChakraProvider>
</LazyMotion>
</yearContext.Provider>
);
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
]
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]
"include": ["next.config.js", "next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]
}