[Beta] Add some types (#4728)

* [Beta] Optimize some performance

* Unnecessary image optimization

* Unused optimizeFonts
This commit is contained in:
ycjcl868
2022-06-08 22:10:24 +08:00
committed by GitHub
parent 0831df4796
commit 022c8ff29d
5 changed files with 13 additions and 3 deletions

View File

@@ -6,7 +6,10 @@ const path = require('path');
const {remarkPlugins} = require('./plugins/markdownToHtml');
const redirects = require('./src/redirects.json');
module.exports = {
/**
* @type {import('next').NextConfig}
**/
const nextConfig = {
pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'],
experimental: {
plugins: true,
@@ -80,3 +83,5 @@ module.exports = {
return config;
},
};
module.exports = nextConfig;

View File

@@ -44,6 +44,7 @@
"@mdx-js/loader": "^1.6.16",
"@types/body-scroll-lock": "^2.6.1",
"@types/classnames": "^2.2.10",
"@types/debounce": "^1.2.1",
"@types/github-slugger": "^1.3.0",
"@types/mdx-js__react": "^1.5.2",
"@types/node": "^14.6.4",

View File

@@ -6,7 +6,7 @@ import React, {createRef} from 'react';
import cn from 'classnames';
import {IconChevron} from 'components/Icon/IconChevron';
import {ChallengeContents} from './Challenges';
const debounce = require('debounce');
import {debounce} from 'debounce';
export function Navigation({
challenges,

View File

@@ -4,7 +4,6 @@
import cn from 'classnames';
import * as React from 'react';
import {siteConfig} from 'siteConfig';
import {forwardRefWithAs} from 'utils/forwardRefWithAs';
export interface HeadingProps {
className?: string;

View File

@@ -846,6 +846,11 @@
dependencies:
classnames "*"
"@types/debounce@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@types/debounce/-/debounce-1.2.1.tgz#79b65710bc8b6d44094d286aecf38e44f9627852"
integrity sha512-epMsEE85fi4lfmJUH/89/iV/LI+F5CvNIvmgs5g5jYFPfhO2S/ae8WSsLOKWdwtoaZw9Q2IhJ4tQ5tFCcS/4HA==
"@types/eslint-visitor-keys@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"